Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Putting Cursor in Cell A1 of each Worksheet, then ending cursor on smalest sheet name according to VBA Editor

Dim WkSheet AsWorksheet
For Each WkSheet In ActiveWorkbook.Worksheets
WkSheet.Activate
ActiveSheet.Range("A1").Activate
ActiveCell.Show
Next


This works beautifully. Now, I would like it to go to Sheet 1
everytime, but none of my sheets are named Sheet 1. I am referring to
the name of the sheet when you go to Visual Basic Editor. In each
workbook, it will show you each Sheet with the actual name of the
sheet in parenthesis. Can anyone help me out? Also, what if sheet 1
is not there, how about bring the cursor to the smallest sheet
number. For examle, if Sheet 1, Sheet 2, and Sheet 4 are missing, the
cursor would end up on Sheet 3 in cell A1 after it ran the code of
macro above. Thanks in advance.

Matt

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Putting Cursor in Cell A1 of each Worksheet, then ending cursor on smalest sheet name according to VBA Editor

Matt,
Depends what you mean by "the smallest sheet number".
ActiveWorkbook.Worksheets(1)

NickHK

"Matt" wrote in message
ups.com...
Dim WkSheet AsWorksheet
For Each WkSheet In ActiveWorkbook.Worksheets
WkSheet.Activate
ActiveSheet.Range("A1").Activate
ActiveCell.Show
Next


This works beautifully. Now, I would like it to go to Sheet 1
everytime, but none of my sheets are named Sheet 1. I am referring to
the name of the sheet when you go to Visual Basic Editor. In each
workbook, it will show you each Sheet with the actual name of the
sheet in parenthesis. Can anyone help me out? Also, what if sheet 1
is not there, how about bring the cursor to the smallest sheet
number. For examle, if Sheet 1, Sheet 2, and Sheet 4 are missing, the
cursor would end up on Sheet 3 in cell A1 after it ran the code of
macro above. Thanks in advance.

Matt



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
move cursor on one sheet moves cursor on all sheets tdworden Excel Discussion (Misc queries) 2 July 22nd 07 10:50 PM
Putting cursor in cell A1 for each worksheet Matt[_40_] Excel Programming 3 March 1st 07 12:09 AM
Down arrow moves cursor to top of worksheet when sheet protected Bill Williams Excel Worksheet Functions 0 April 29th 06 06:37 PM
Can I change the "white cross" cursor in Excel to another cursor? KFEagle Excel Discussion (Misc queries) 1 May 3rd 05 08:01 PM
make an excel worksheet (sheet 2) open w/ the cursor located in t. animated text in excel worksheet Excel Discussion (Misc queries) 0 February 10th 05 10:29 PM


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