I have a user getting a run time error from the following code, but I can't see how - any suggestions?
Private Sub buttonViewPatient_Click()
Application.ScreenUpdating = True
ActiveWindow.DisplayWorkbookTabs = True
Sheets("data").Select
End Sub
Printable View
I have a user getting a run time error from the following code, but I can't see how - any suggestions?
Private Sub buttonViewPatient_Click()
Application.ScreenUpdating = True
ActiveWindow.DisplayWorkbookTabs = True
Sheets("data").Select
End Sub
hi, dseaforduk.. looks like the code you posted is okay..so i suppose the error is not coming from that code.. :)
Welcome to the forums dseaforduk :wave:
You will get that error if Sheets("data") is hidden. Change your code to this...
Code:Private Sub buttonViewPatient_Click()
Application.ScreenUpdating = True
Sheets("data").Visible = True
Sheets("data").Activate
End Sub
Thanks for the feedback
The sheet is not hidden, tab names are, I will try Activate rather than Select.
Use debugger to find error. When error show click debug and press F8 to make step in. Or toggle breakpoint in ur vba code and do f8 and check what data is setted to variable. Always u can use Error Handlers.