Macro Line Inoperative

P

Phil Hageman

The following subs are examples of macros assigned to
forms buttons to move the user among various worksheets.
Suddenly, the "Range ("A1").Select" line does not work for
any of the subs. Can someone suggest what I have done to
mess this up?

Sub GoToMetrics()
Application.ScreenUpdating = False
Sheets("Metrics").Select
Range("A1").Select
ActiveWindow.Zoom = 57
Application.ScreenUpdating = True
End Sub

Sub GoToMetric1()
Application.ScreenUpdating = False
Sheets("Metrics").Select
Range("A1").Select
ActiveWindow.Zoom = 57
With ActiveSheet.ChartObjects("Chart 13")
.Height = 660
.Width = 780
.Top = 10
.Left = 125
.BringToFront
End With
Application.ScreenUpdating = True
End Sub
 
R

RADO

Most likely you changed the name of the Sheet "Metrics" and your subs can't
find it any more. make sure such sheet exists.

Also, you cxan simplify your subs like this:

Sub GoToMetrics()
Application.ScreenUpdating = False
Sheets("Metrics").Range("A1").Select
ActiveWindow.Zoom = 57
Application.ScreenUpdating = True
End Sub
 
T

Tom Ogilvy

If sheets("Metrics") is not the activesheet, this simplification would just
raise an error - so this really isn't a simplification. If this
simplification would work, then there is no need to have sheet("Metrics") in
the code at all. But I doubt that is the case.


To the OP.

Did you change the location of the code. Did you put it in a sheet module.
It should be in a general module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top