Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sub A1 Line Malfunction
The Sub below is attached to a forms control button, and
the line Range ("A1").Select is not working. Can someone help correct this? 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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sub A1 Line Malfunction
Why something "is not working" is almost always impossible to diagnose.
Would you care to share some details? What happens? Is there an error message? If so, what is it? If not, does the rest of the Sub continue? Do you have the code in a standard module? And why do you want to select A1 anyway? -- Vasant "Phil Hageman" wrote in message ... The Sub below is attached to a forms control button, and the line Range ("A1").Select is not working. Can someone help correct this? 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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sub A1 Line Malfunction
Is your code in a General module--or under a worksheet?
(Try putting it in a general module if it's not there already.) Phil Hageman wrote: The Sub below is attached to a forms control button, and the line Range ("A1").Select is not working. Can someone help correct this? 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 -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sub A1 Line Malfunction
And just to add, if it's under a worksheet module, then this line:
Range("A1").Select has a problem. Range("a1") is an unqualified reference. In a general module, it'll refer to the activesheet. But behind a worksheet, it refers to the sheet containing the code. And you can't select a range on a sheet that isn't active. (and Metrics is the active sheet). Phil Hageman wrote: The Sub below is attached to a forms control button, and the line Range ("A1").Select is not working. Can someone help correct this? 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 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Validation malfunction | Excel Discussion (Misc queries) | |||
Excel malfunction | Excel Discussion (Misc queries) | |||
Software Malfunction | Excel Discussion (Misc queries) | |||
Help Excel malfunction | Excel Discussion (Misc queries) | |||
pPMT malfunction | Excel Worksheet Functions |