I need to pull a sheet’s position in a workbook knowing only it’s name — so for instance:
if we have a sheet, say
Workbook.Sheets("Sheet2")
how would I find the corresponding integer so that I could refer to it as:
say i is an integer
Workbook.Sheets(i)
I need to be able to do this reverse indicing so I can refer to sheets next to the sheet I’m referencing.
Thank you for your help.
Edit: brettdj’s answer inspired me, so I wrote this function which could probably be cleaned up infact thinking about it, if I were actually going to use and support this I would probably make a find sheet function instead of what the sub does if you say true for the 4th parameter:
Here are some usage examples:
‘Usage Examples