davedave24
Programmer
I'm trying to select a specific worksheet upon exit of the userform, but it's generating the error 'Type Mismatch'.
The name of the form is loaded into a textbox named textQuoteNo. This is populated from the actual sheet the userform is loaded from.
As the form fetches data for comboboxes from another sheet ("Data"), when I exit the userform, it dumps me on the Data worksheet.
I've tried combinations of .Activate, ThisWorkbook etc. but it still gives the error.
The code works fine if I specify a sheet name, ie
The name of the form is loaded into a textbox named textQuoteNo. This is populated from the actual sheet the userform is loaded from.
As the form fetches data for comboboxes from another sheet ("Data"), when I exit the userform, it dumps me on the Data worksheet.
Code:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Sheets(textQuoteNo).Select
End Sub
I've tried combinations of .Activate, ThisWorkbook etc. but it still gives the error.
The code works fine if I specify a sheet name, ie
Code:
Sheets("Quotes").Select