Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Scoll so taht the active cell is in the first line on the screen

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default Scoll so taht the active cell is in the first line on the screen

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Scoll so taht the active cell is in the first line on the screen

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Scoll so taht the active cell is in the first line on the screen

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
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
Displaying active cell in particular position on screen MJKelly Excel Programming 4 April 19th 08 07:17 PM
Screen does not scroll as active cell moves down the page KimC Excel Discussion (Misc queries) 3 May 8th 07 06:45 PM
how do I keep the active cell or row in the middle of the screen RLD7 Excel Discussion (Misc queries) 1 April 19th 06 03:05 PM
Active cell moves off the screen John W. Excel Discussion (Misc queries) 1 November 15th 05 11:12 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 05:50 AM.

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

About Us

"It's about Microsoft Excel"