Z
Zippy
I have a bit of VBA code in an excel spreadsheet macro which checks that all
of the name sheets are present. Now what I would like is if a sheet such as
the last one has been given a capital R in the word routine or the sheet AA
Prime was written as aa prime it would still pass the sheet exists test.
Any clues as how I could do this? My code at present is shown below and it
works OK as long as the sheet names are written exactly as listed in the
array.
TIA.
Zippy
Sheetname = Array("00100", "00200", "00300", "00301", "00040A", "04000",
"00600", "00675", "00650", "05001", "05213", "05005A", "05005B", "05000C",
"33500", "03101", "06179", "06188", "06222G", "18390", "07010C", "07150",
"07200", "07290", "07291", "07400B", "20550", "07555B", "07777", "00400",
"00888", "22471", "30699", "30889", "AA Prime", "Style", "Status", "First
check", "Prime A", "Prime B", "Clean routine")
tabname = 1
Do While tabname < 42
SheetExists = False
For Each ws In Worksheets
If ws.Name = Sheetname(tabname) Then
SheetExists = True
Else
SheetExists = False
GoTo NoSuchSheet
End If
tabname = tabname + 1
Next ws
Loop
NoSuchSheet:
If Not SheetExists Then
Application.ScreenUpdating = True
MsgBox "Sheet " + (Sheetname(tabname)) + " does not exist"
End
Else
End If
of the name sheets are present. Now what I would like is if a sheet such as
the last one has been given a capital R in the word routine or the sheet AA
Prime was written as aa prime it would still pass the sheet exists test.
Any clues as how I could do this? My code at present is shown below and it
works OK as long as the sheet names are written exactly as listed in the
array.
TIA.
Zippy
Sheetname = Array("00100", "00200", "00300", "00301", "00040A", "04000",
"00600", "00675", "00650", "05001", "05213", "05005A", "05005B", "05000C",
"33500", "03101", "06179", "06188", "06222G", "18390", "07010C", "07150",
"07200", "07290", "07291", "07400B", "20550", "07555B", "07777", "00400",
"00888", "22471", "30699", "30889", "AA Prime", "Style", "Status", "First
check", "Prime A", "Prime B", "Clean routine")
tabname = 1
Do While tabname < 42
SheetExists = False
For Each ws In Worksheets
If ws.Name = Sheetname(tabname) Then
SheetExists = True
Else
SheetExists = False
GoTo NoSuchSheet
End If
tabname = tabname + 1
Next ws
Loop
NoSuchSheet:
If Not SheetExists Then
Application.ScreenUpdating = True
MsgBox "Sheet " + (Sheetname(tabname)) + " does not exist"
End
Else
End If