?sheet4.codename
Sheet4
?sheet4.name
report1442310827144
?sheets(sheet4.name).name
report1442310827144
?sheets(4).name
report1442310827144
It all depends what you know about the structure of the workbook and what the sheet names, and code names might be.
You can loop through the sheets to determine what sheet names are present. For example:
for i = 1 to worksheets.Count: debug.Print sheets(i).codename, sheets(i).name: next i
Sheet1 Sheet1
Sheet2 Sheet2
Sheet3 Sheet3
Sheet4 report1442310827144
Regards, TMS
Bookmarks