Putting Cursor in Cell A1 of each Worksheet, then ending cursor on smalest sheet name according to V

M

Matt

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
 
N

NickHK

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

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top