View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default 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