Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I activate the first worksheet?
I want to activate the first worksheet out of x number in a workbook.
The sheet names will vary every time, so I was wondering how you select the first sheet using generic code. Thanks, Mel |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I activate the first worksheet?
Worksheets(1).Activate
hth keith |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I activate the first worksheet?
Excellent, and so simple! Cheers Keith.
Is there a way of activating the last sheet again? There may be any number of sheets so I guess its not Worksheets(20 or whatever).Activate Thanks, Mel "Keith74" wrote: Worksheets(1).Activate hth keith |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I activate the first worksheet?
You might try:
Sub LastSht() Dim CntSheets As Long 'Activate last worksheet in the workbook With Application CntSheets = .Sheets.Count - .Charts.Count .Worksheets(CntSheets).Activate End With End Sub "Meltad" wrote: Excellent, and so simple! Cheers Keith. Is there a way of activating the last sheet again? There may be any number of sheets so I guess its not Worksheets(20 or whatever).Activate Thanks, Mel "Keith74" wrote: Worksheets(1).Activate hth keith |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Add-ins and Worksheet activate | Excel Programming | |||
Change Worksheet Button Caption on Worksheet.Activate | Excel Programming | |||
Activate a Worksheet | Excel Programming | |||
Activate Previous worksheet after adding a new worksheet | Excel Programming | |||
Activate Worksheet | Excel Programming |