willyboy58
Technical User
The seemingly simple stuff drives me crazy!
The user clicks a button “Process Data”. An input box opens and gives the user 3 choices: 1)Enter month and year to process data 2) click OK to view the raw data without processing or 3) click CANCEL and close the activeworkbook without viewing or processing data. I have the following code:
Public ReportMonth As String
Sub MonthAndYear()
Application.ScreenUpdating = False
ReportMonth = InputBox("Enter the FULL name of the month" _
& "to be processed followed by the FOUR DIGIT year. If " _
& "you want to view the raw data, select OK. If you " _
& "want to close the workbook and exit now, select " _ & "CANCEL", Type:=4)
If ReportMonth = "" Then
End 'closes input box but does not close _
raw data workbook, which is OK
If ReportMonth = False Then
ActiveWorkbook.Close
'This is where the user selects CANCEL and the _ activeworkbook shoulc close. Instead I get the _ message "Named arguement not found"
End If
End If
Application.ScreenUpdating = True
End Sub
TIA
Bill
The user clicks a button “Process Data”. An input box opens and gives the user 3 choices: 1)Enter month and year to process data 2) click OK to view the raw data without processing or 3) click CANCEL and close the activeworkbook without viewing or processing data. I have the following code:
Public ReportMonth As String
Sub MonthAndYear()
Application.ScreenUpdating = False
ReportMonth = InputBox("Enter the FULL name of the month" _
& "to be processed followed by the FOUR DIGIT year. If " _
& "you want to view the raw data, select OK. If you " _
& "want to close the workbook and exit now, select " _ & "CANCEL", Type:=4)
If ReportMonth = "" Then
End 'closes input box but does not close _
raw data workbook, which is OK
If ReportMonth = False Then
ActiveWorkbook.Close
'This is where the user selects CANCEL and the _ activeworkbook shoulc close. Instead I get the _ message "Named arguement not found"
End If
End If
Application.ScreenUpdating = True
End Sub
TIA
Bill