Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Is there an object containing the sheet names for a workbook
Hi,
here's the problem. I have worksheets containing the same kind of data and would like to consolidate data from the sheet with some restrictions. And I would like construct some sort of macro for this task since it will be repeated quite often. But the set of sheets in the workbook will probeably change over time. Is there a method for finding the names of the sheets in an workbook so that a could loop over the existing sheets? /Niklas |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Is there an object containing the sheet names for a workbook
Sub saysheet()
For Each sh In Worksheets MsgBox (sh.Name) Next End Sub -- Gary''s Student - gsnu200741 "Niklas M" wrote: Hi, here's the problem. I have worksheets containing the same kind of data and would like to consolidate data from the sheet with some restrictions. And I would like construct some sort of macro for this task since it will be repeated quite often. But the set of sheets in the workbook will probeably change over time. Is there a method for finding the names of the sheets in an workbook so that a could loop over the existing sheets? /Niklas |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Is there an object containing the sheet names for a workbook
There is also Worksheets.Count that tells you how many worksheets, or
Sheets.Count that tells you the number of sheets (worksheets, charts, etc.) -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Gary''s Student" wrote in message ... Sub saysheet() For Each sh In Worksheets MsgBox (sh.Name) Next End Sub -- Gary''s Student - gsnu200741 "Niklas M" wrote: Hi, here's the problem. I have worksheets containing the same kind of data and would like to consolidate data from the sheet with some restrictions. And I would like construct some sort of macro for this task since it will be repeated quite often. But the set of sheets in the workbook will probeably change over time. Is there a method for finding the names of the sheets in an workbook so that a could loop over the existing sheets? /Niklas |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Iterating Through Workbook if Don't Know Sheet Names | Excel Programming | |||
View All Sheet Names in Workbook at Once | Excel Discussion (Misc queries) | |||
Using Sheet names & Workbook names in VBA coding | Excel Programming | |||
Retrieving the sheet names of another workbook | Excel Programming |