Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I would like to write a macro that lets me go fra a button placed in A1 to for example cell A40 and the row 40 should be the first line on the screen.. I then want the macro to move the cursor 2 rows down and still have row 40 as the first line on the sceen. Anybody that can help |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub test()
Range("A42").Select ActiveWindow.ScrollRow = 40 ActiveWindow.ScrollColumn = 1 End Sub HTH. Best wishes Harald "WalterK" wrote in message ... Hi I would like to write a macro that lets me go fra a button placed in A1 to for example cell A40 and the row 40 should be the first line on the screen.. I then want the macro to move the cursor 2 rows down and still have row 40 as the first line on the sceen. Anybody that can help |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Put this in your sheet code module. It will move any cell selected to the
top left cell of the screen. Private Sub Worksheet_SelectionChange(ByVal Target As Range) ActiveWindow.ScrollRow = Target.Row ActiveWindow.ScrollColumn = Target.Column End Sub However, I do not think you will be totally happy with it. "WalterK" wrote: Hi I would like to write a macro that lets me go fra a button placed in A1 to for example cell A40 and the row 40 should be the first line on the screen.. I then want the macro to move the cursor 2 rows down and still have row 40 as the first line on the sceen. Anybody that can help |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What you might want to do is put the scroll code behind a button and just use
the button to move the cell up instead of the selection change event. "WalterK" wrote: Hi I would like to write a macro that lets me go fra a button placed in A1 to for example cell A40 and the row 40 should be the first line on the screen.. I then want the macro to move the cursor 2 rows down and still have row 40 as the first line on the sceen. Anybody that can help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Displaying active cell in particular position on screen | Excel Programming | |||
Screen does not scroll as active cell moves down the page | Excel Discussion (Misc queries) | |||
how do I keep the active cell or row in the middle of the screen | Excel Discussion (Misc queries) | |||
Active cell moves off the screen | Excel Discussion (Misc queries) | |||
Moving the Active cell to the left of the screen | Excel Programming |