Macro Help...Skipping tabs not present


I recorded a macro that essentially grabs tabs from a source spreadsheet, titles them, and saves them in an appropriate folder. The problem begins when the source spreadsheet comes in next month without one of the tabs that was present in the prior month. What is the easiest way to tell the macro to skip grabbing the tab if it isn't present? Currently, the macro bugs out when the source sheet is missing a tab that was present in the prior month. Thanks is advance.
Who is Participating?
nutschConnect With a Mentor Commented:
you can do

on error resume next
debug.print sheets("Missing tab").cells(1,1)

if err=0 then
'tab Missing tab exists
'tab Missing tab doesn't exist
end if

on error goto 0

Open in new window

aikimarkConnect With a Mentor Commented:
Iterate the worksheets as a collection, rather than by name.
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
    'put your processing code here

Open in new window

Martin LissOlder than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.