TheSwamp
Code Red => VB(A) => Topic started by: krampaul82 on April 30, 2015, 01:20:15 PM
-
Hello Swampers
I have this code;
' Zoom_To_Total Macro
'Takes you to a grand total of items in the Bill of materials work sheet
Sub Zoom_to_total()
On Error GoTo theerror1 'End the Sub on error
Sheet1("Bill of Materials").Select 'Error If not Bill of Materials Work Sheet
Range("EF87").Select
theerror1: End
End Sub
My question;
why does it launch sheet1 and then run the code? I do not recall this happening before. It is doing it all of a sudden.
any help appreciated
Mark
-
Are you trying to select Cell EF87 on worksheet "Bill of Material"?
If so, I'm not sure why you are using Sheet1.
You should be able to do something like this:
' Zoom_To_Total Macro
'Takes you to a grand total of items in the Bill of materials work sheet
Sub Zoom_to_total()
On Error GoTo theerror1 'End the Sub on error
Worksheets("Bill of Materials").Select 'Error If not Bill of Materials Work Sheet
Range("EF87").Select
theerror1: End
End Sub
-
Are you trying to select Cell EF87 on worksheet "Bill of Material"?
If so, I'm not sure why you are using Sheet1.
You should be able to do something like this:
' Zoom_To_Total Macro
'Takes you to a grand total of items in the Bill of materials work sheet
Sub Zoom_to_total()
On Error GoTo theerror1 'End the Sub on error
Worksheets("Bill of Materials").Select 'Error If not Bill of Materials Work Sheet
Range("EF87").Select
theerror1: End
End Sub
It seemed to be an office 2013 issue, I now have it fixed Thank you mmelone for your reply.