How to select an added worksheet
When you add a sheet, it is automaticly selected.
Sub AddSheet()
Sheets.Add
End Sub
If you have a large workbook and you want a list of all sheetnames:
Sub List()
Dim ws As Worksheet
Sheets("List").Activate
Range("A1").Activate
For Each ws In Worksheets
ActiveCell.Formula = ws.Name
ActiveCell.Offset(1, 0).Select
Next
End Sub
"davegb" schreef in bericht
oups.com...
When I add a new worksheet, how do I select it? I don't know which
number it is, since I don't know how many sheets there are. Do I have
to count the sheets to find out how many there are, then add the
worksheet and select the next number higher than the count?
Thanks for the help!
|