Extra Sheet in Workbook (Menu Sheet)

  • Thread starter Thread starter Jack Gillis
  • Start date Start date
J

Jack Gillis

I was doing some work in VBA for a macro and could get it to work on
some workbooks but not others. The macro uses a For loop to cycle
through all the sheets in a workbook and perform identical operations on
each. I found the problem with the offending workbooks and can fix the
macro to make it work on them but then it won't work on the others.

The problem is some workbooks have an 'un-tabbed' sheet named Menu Sheet
according to VBA's Project Explorer. It is Sheet 11 and how it got there
with that number, I haven't a clue for my other sheets are 1 through 6.
I discovered this when I examined what Sheets.Count returned and found
it was one more than the number of Tabs in the workbook.

I've no idea what 'Menu Sheet' is or where it came from. Is it really
needed? I can't find a way to delete it anyway. I can program around
it, I think if I can find a way to detect its presence, but I wonder how
many other such things can crop up to mess up what I hope to be a
general purpose macro.

I hope I have made the question clear and I will really appreciate any
insight to this vexing thing.
 
By untabbed, might you mean it was hidden? It probably did not get there by
itself or devine intervention. So, you could maybe unhide it and remove or

for each sh
if sh.name <> "Menu" then
 
Maybe you could use and If Statement and combine the code for both types of
workbooks. The If Statement could decide which section of code is right for
each workbook and run accordingly.

Wayman
 
Thank you, Don. It was hidden. I did unhide it found it useless and
deleted it. Like J. Buffett's tattoo, I don't have a clue how it got
there.
 
Back
Top