Author Topic: vbA Excel  (Read 2608 times)

0 Members and 1 Guest are viewing this topic.

krampaul82

  • Newt
  • Posts: 179
vbA Excel
« 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
When i see someone fall, my first instinct is to laugh!
but then i think, wait a minute! they could of fallen on ME!
Mark

mmelone

  • Mosquito
  • Posts: 11
Re: vbA Excel
« Reply #1 on: May 04, 2015, 02:51:24 PM »
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:

Code: [Select]
' 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

krampaul82

  • Newt
  • Posts: 179
Re: vbA Excel
« Reply #2 on: May 05, 2015, 12:29:37 PM »
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:

Code: [Select]
' 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.
When i see someone fall, my first instinct is to laugh!
but then i think, wait a minute! they could of fallen on ME!
Mark