Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Position Cursor to A1

How do I position the cursor to cell A1? I tried:

Sub PositionCursorToUpperLeft()
Dim ws As Worksheet
application.ScreenUpdating = False
For Each ws In Worksheets
ws.Activate
ws.Range("A1").Select
Next ws
' --- Go back to the first sheet.
Worksheets("Select").Activate
application.ScreenUpdating = True
End Sub

This almost works, but fails on the last sheet.

"A1" is selected, but the worksheet window is positioned with "A532" at the
top of the window. What I'm trying to get to is to have the worksheet window
view begin at "A1".

Thanks in advance for your assistance.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Position Cursor to A1

Hi Dennis

Try this

Sub Test()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
Application.Goto ws.Range("A1"), True
Next
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dennis Damsgaard" wrote in message ...
How do I position the cursor to cell A1? I tried:

Sub PositionCursorToUpperLeft()
Dim ws As Worksheet
application.ScreenUpdating = False
For Each ws In Worksheets
ws.Activate
ws.Range("A1").Select
Next ws
' --- Go back to the first sheet.
Worksheets("Select").Activate
application.ScreenUpdating = True
End Sub

This almost works, but fails on the last sheet.

"A1" is selected, but the worksheet window is positioned with "A532" at the
top of the window. What I'm trying to get to is to have the worksheet window
view begin at "A1".

Thanks in advance for your assistance.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Position Cursor to A1

Oh! Very cool. Thanks for your help.



*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Position Cursor to A1

Oh! Very cool. Thanks for your help.
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!


They reward you for being helped for free ?

Best wishes Harald


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
Cursor position to get colour [email protected] Excel Worksheet Functions 6 November 30th 07 01:27 AM
cursor position MarkT Excel Discussion (Misc queries) 5 February 7th 07 01:25 PM
Cursor position saziz Excel Discussion (Misc queries) 2 August 9th 05 08:19 PM
Cursor position? Marc Excel Discussion (Misc queries) 1 March 27th 05 07:09 PM
cursor position NTL Excel Programming 1 January 18th 04 08:23 PM


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