Skipping a tab when with this macro
I just realized that I may need to skip more than one sheet when running the
macro. I have tried copying and pasting in the critical parts (if else
statement) with the other worksheet name, but it brings up a "For" error when
it gets to the "Next" statement whenever I try it. Any suggestions on how I
can set it up to be able to add more sheets to the "ignore list?" Thanks
again for the speedy replies and the time!
-Kai
"Dave Peterson" wrote:
For Each ws In Worksheets
if lcase(ws.name) = lcase("sheet1") then
'skip it
else
i = i + 1
Cells(i + 3, 1).value = ws.Name
end if
Next ws
Kai Cunningham wrote:
I am currently using this macro to populate a column with the names of each
tab I have in a workbook. I would like to be able to exclude a tab when this
macro runs. If the tab name is Sheet1, how would I exclude it from showing
up in my column?
For Each ws In Worksheets
i = i + 1
Cells((i + 3), 1) = ws.Name
Next
Thanks for your time!
-Kai
--
Dave Peterson
|