C
Craig_Richards
Hello,
I'm not the most experienced of macro writers but can normally muddle
through inelegantly enough. However this one has got me stuck. Can
anyone help?
I am trying to run a macro for all visible worksheets in a workbook and
failing gallantly. This is my code:
Sub update()
application.ScreenUpdating = False
Dim sht As Worksheet
For Each sht In ActiveWorkbook.Worksheets
If sht.Name = "End" Then GoTo finish
sht.Select
Range("A1").Select
RC = EssMenuVRetrieve()
Next sht
finish:
application.ScreenUpdating = True
End Sub
It updates the visible sheets fine but then I get run time error 1004
saying that Method 'select of object'_worksheet failed
Any ideas? I think I have probably not defined the final sheet
correctly but I thought it worked that way.
I appreaciate any feedback you could hive me.
Thanks
I'm not the most experienced of macro writers but can normally muddle
through inelegantly enough. However this one has got me stuck. Can
anyone help?
I am trying to run a macro for all visible worksheets in a workbook and
failing gallantly. This is my code:
Sub update()
application.ScreenUpdating = False
Dim sht As Worksheet
For Each sht In ActiveWorkbook.Worksheets
If sht.Name = "End" Then GoTo finish
sht.Select
Range("A1").Select
RC = EssMenuVRetrieve()
Next sht
finish:
application.ScreenUpdating = True
End Sub
It updates the visible sheets fine but then I get run time error 1004
saying that Method 'select of object'_worksheet failed
Any ideas? I think I have probably not defined the final sheet
correctly but I thought it worked that way.
I appreaciate any feedback you could hive me.
Thanks