Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default Move Cell to Top/Left Position on Screen

I am using variations (different chart names) of the
following code to size and position a series of imbedded
charts (in one worksheet) on screen such that they display
exactly on top of each other. This code is attached to a
forms command button in another worksheet to execute the
code. Works great. Now I need to do a similar thing
within a different worksheet, but instead of a chart, I
want to use three merged cell ranges: B1:BA1, B33:BA33,
and B65:BA65 as the point to be located at, say, Top = 10,
Left = 150. I do not want to resize, just have the cell
go to 10/150. How this should work: user clicks the
button and cell range B33 moves to 10/150, for example.
In this B33 example, I would call the macro DisplayB33.

Seems the code should be simple and straightforward, but I
can't figure out how to do it. Tried the macro generator
to no avail. Can someone help with the code?

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Move Cell to Top/Left Position on Screen

Objects can have their position changed, ranges cannot.

What you could do though is change what the active window is looking at.
By using ActiveWindow.SmallScroll you can make the window show the cells
close to the position you want.

Let me know what your options are?


"Phil Hageman" wrote in message
...
I am using variations (different chart names) of the
following code to size and position a series of imbedded
charts (in one worksheet) on screen such that they display
exactly on top of each other. This code is attached to a
forms command button in another worksheet to execute the
code. Works great. Now I need to do a similar thing
within a different worksheet, but instead of a chart, I
want to use three merged cell ranges: B1:BA1, B33:BA33,
and B65:BA65 as the point to be located at, say, Top = 10,
Left = 150. I do not want to resize, just have the cell
go to 10/150. How this should work: user clicks the
button and cell range B33 moves to 10/150, for example.
In this B33 example, I would call the macro DisplayB33.

Seems the code should be simple and straightforward, but I
can't figure out how to do it. Tried the macro generator
to no avail. Can someone help with the code?

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Move Cell to Top/Left Position on Screen

Easiest would be just to put it in the window

Sub B33Size()
Range(B33:BA33).Select
ActiveWindow.Zoom = True
Range("B33").Select
End Sub

if you want to move it down a bit

Sub B33Size()
Range(B33:BA33).Select
ActiveWindow.Zoom = True
Range("B25").Select
End Sub

--
Regards,
Tom Ogilvy

"Phil Hageman" wrote in message
...
I am using variations (different chart names) of the
following code to size and position a series of imbedded
charts (in one worksheet) on screen such that they display
exactly on top of each other. This code is attached to a
forms command button in another worksheet to execute the
code. Works great. Now I need to do a similar thing
within a different worksheet, but instead of a chart, I
want to use three merged cell ranges: B1:BA1, B33:BA33,
and B65:BA65 as the point to be located at, say, Top = 10,
Left = 150. I do not want to resize, just have the cell
go to 10/150. How this should work: user clicks the
button and cell range B33 moves to 10/150, for example.
In this B33 example, I would call the macro DisplayB33.

Seems the code should be simple and straightforward, but I
can't figure out how to do it. Tried the macro generator
to no avail. Can someone help with the code?

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Move Cell to Top/Left Position on Screen

Receiving Compile Error: Syntax Error, Line:Range(B33:BA33).Select i
highlighted

Tom Ogilvy wrote:
*Easiest would be just to put it in the window

Sub B33Size()
Range(B33:BA33).Select
ActiveWindow.Zoom = True
Range("B33").Select
End Sub

if you want to move it down a bit

Sub B33Size()
Range(B33:BA33).Select
ActiveWindow.Zoom = True
Range("B25").Select
End Sub

--
Regards,
Tom Ogilvy

"Phil Hageman" wrote i
message
...
I am using variations (different chart names) of the
following code to size and position a series of imbedded
charts (in one worksheet) on screen such that they display
exactly on top of each other. This code is attached to a
forms command button in another worksheet to execute the
code. Works great. Now I need to do a similar thing
within a different worksheet, but instead of a chart, I
want to use three merged cell ranges: B1:BA1, B33:BA33,
and B65:BA65 as the point to be located at, say, Top = 10,
Left = 150. I do not want to resize, just have the cell
go to 10/150. How this should work: user clicks the
button and cell range B33 moves to 10/150, for example.
In this B33 example, I would call the macro DisplayB33.

Seems the code should be simple and straightforward, but I
can't figure out how to do it. Tried the macro generator
to no avail. Can someone help with the code?

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


--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Move Cell to Top/Left Position on Screen

A slight typo, try:

Range("B33:BA33").Select



"pjhageman <" wrote:

Receiving Compile Error: Syntax Error, Line:Range(B33:BA33).Select is
highlighted

Tom Ogilvy wrote:
*Easiest would be just to put it in the window

Sub B33Size()
Range(B33:BA33).Select
ActiveWindow.Zoom = True
Range("B33").Select
End Sub

if you want to move it down a bit

Sub B33Size()
Range(B33:BA33).Select
ActiveWindow.Zoom = True
Range("B25").Select
End Sub

--
Regards,
Tom Ogilvy

"Phil Hageman" wrote in
message
...
I am using variations (different chart names) of the
following code to size and position a series of imbedded
charts (in one worksheet) on screen such that they display
exactly on top of each other. This code is attached to a
forms command button in another worksheet to execute the
code. Works great. Now I need to do a similar thing
within a different worksheet, but instead of a chart, I
want to use three merged cell ranges: B1:BA1, B33:BA33,
and B65:BA65 as the point to be located at, say, Top = 10,
Left = 150. I do not want to resize, just have the cell
go to 10/150. How this should work: user clicks the
button and cell range B33 moves to 10/150, for example.
In this B33 example, I would call the macro DisplayB33.

Seems the code should be simple and straightforward, but I
can't figure out how to do it. Tried the macro generator
to no avail. Can someone help with the code?

Sub GoToMetric6()
Application.ScreenUpdating = False
Sheets("Metrics").Select
ActiveWindow.Zoom = 57
Range("A1").Select
With ActiveSheet.ChartObjects("Chart 56")
.Height = 660
.Width = 780
.Top = 10
.Left = 150
.BringToFront
End With
Application.ScreenUpdating = True
End Sub
*


---
Message posted from http://www.ExcelForum.com/


--

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
Scroll a cell to the top left hand corner of the screen Daveh Excel Discussion (Misc queries) 2 August 30th 06 05:17 PM
Why does cursor move position in a cell I'm trying to edit? BrendaK Excel Discussion (Misc queries) 3 August 22nd 05 10:32 PM
How do I move the current cell to the top of the screen? mad.cow Excel Discussion (Misc queries) 6 May 29th 05 05:35 AM
How can I move the comment box to the left of the cell? Frederic Excel Worksheet Functions 0 May 25th 05 02:25 PM
Moving the Active cell to the left of the screen Dave Bash Excel Programming 1 December 17th 03 04:11 PM


All times are GMT +1. The time now is 11:17 AM.

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"