Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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
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
Validation malfunction Geri Excel Discussion (Misc queries) 0 May 10th 08 03:50 PM
Excel malfunction OG Excel Discussion (Misc queries) 4 February 22nd 08 01:37 AM
Software Malfunction Clairemont[_2_] Excel Discussion (Misc queries) 1 November 25th 07 11:40 AM
Help Excel malfunction mingster Excel Discussion (Misc queries) 9 July 21st 06 09:46 PM
pPMT malfunction Louis Zaffino Excel Worksheet Functions 1 May 3rd 06 07:13 PM


All times are GMT +1. The time now is 09:00 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"