Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
move cursor on one sheet moves cursor on all sheets | Excel Discussion (Misc queries) | |||
Putting cursor in cell A1 for each worksheet | Excel Programming | |||
Down arrow moves cursor to top of worksheet when sheet protected | Excel Worksheet Functions | |||
Can I change the "white cross" cursor in Excel to another cursor? | Excel Discussion (Misc queries) | |||
make an excel worksheet (sheet 2) open w/ the cursor located in t. | Excel Discussion (Misc queries) |