View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Matt[_40_] Matt[_40_] is offline
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