Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default Macro Line Inoperative

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Macro Line Inoperative

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




"Phil Hageman" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro Line Inoperative

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.

--
Regards,
Tom Ogilvy



"RADO" wrote in message
...
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




"Phil Hageman" wrote in message
...
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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro code to put series name next to individual line in line grap Otani Charts and Charting in Excel 3 February 23rd 10 07:24 PM
Macro with line graph Sasikiran Excel Discussion (Misc queries) 2 November 19th 09 02:13 PM
Inoperative merge function Kobo Excel Worksheet Functions 0 April 20th 06 12:26 AM
Macro - Skipping a line PaulPoll Excel Worksheet Functions 4 December 21st 04 12:43 AM
Line Chart Macro DataMan[_3_] Excel Programming 0 November 17th 03 10:26 PM


All times are GMT +1. The time now is 10:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"