Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting all of the sheets in a workbook
How would I go creating a macro or VBA that selects all of the worksheets in
a given workbook. This needs to work regardless of how many sheets there are. i.e. workbook1 may contain 5 worksheets where as workbook2 may contain 8. -- Cyberwolf Finder of Paths, Hunter of Prey Ghost of the Night, Shadow of Day The Wolf |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting all of the sheets in a workbook
This will select all visible sheets.
Sub selectAll() Dim ws As Worksheet For Each ws In Sheets If ws.Visible Then ws.Select False Next End Sub Cyberwolf wrote: How would I go creating a macro or VBA that selects all of the worksheets in a given workbook. This needs to work regardless of how many sheets there are. i.e. workbook1 may contain 5 worksheets where as workbook2 may contain 8. -- Cyberwolf Finder of Paths, Hunter of Prey Ghost of the Night, Shadow of Day The Wolf |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting all of the sheets in a workbook
sheets.select
-- Don Guillett Microsoft MVP Excel SalesAid Software "Cyberwolf" wrote in message ... How would I go creating a macro or VBA that selects all of the worksheets in a given workbook. This needs to work regardless of how many sheets there are. i.e. workbook1 may contain 5 worksheets where as workbook2 may contain 8. -- Cyberwolf Finder of Paths, Hunter of Prey Ghost of the Night, Shadow of Day The Wolf |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting all of the sheets in a workbook
Don, that could will work perfectly as long as no sheets are hidden.
If there are hidden sheets in the workbook, a 1004 error occurs. Regards, Jeff Don Guillett wrote: sheets.select -- Don Guillett Microsoft MVP Excel SalesAid Software "Cyberwolf" wrote in message ... How would I go creating a macro or VBA that selects all of the worksheets in a given workbook. This needs to work regardless of how many sheets there are. i.e. workbook1 may contain 5 worksheets where as workbook2 may contain 8. -- Cyberwolf Finder of Paths, Hunter of Prey Ghost of the Night, Shadow of Day The Wolf |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
selecting a single sheet from a volume of sheets in a workbook | Excel Worksheet Functions | |||
Selecting data from 1 workbook to copy and paste to a 2nd workbook | Excel Programming | |||
VBA: selecting sheets and copy them to a workbook | Excel Programming | |||
selecting sheets | Excel Programming | |||
Changing the value in multiple sheets without selecting those sheets | Excel Programming |