I have a a number of workbooks that each have 19 tabs. I have a macro that goes through each tab and hides some blank rows.
My current macro, as an example for one tab is as follows:
Sheets("1000").Select
ActiveSheet.Unprotect
ActiveSheet.Range("$A$1:$A$700").AutoFilter Field:=1, Criteria1:="1"
ActiveSheet.Protect
The sheet name "1000" is only applicable in one workbook, in another workbook the number scheme may change to "6001" as an example.
I would rather have my macro refer to a key to lookup the tab name, than actually hardcode the tab names in the macro.
For example, I have a tab called "Departments", and cells A1:A19 contain the department code that also corresponds to the tab names in each of the workbooks. I would prefer the macro pull the tab names from here, so that when I copy this workbook out I can change the "Departments" tab instead of the macro.
Thank you in advance for your help.
My current macro, as an example for one tab is as follows:
Sheets("1000").Select
ActiveSheet.Unprotect
ActiveSheet.Range("$A$1:$A$700").AutoFilter Field:=1, Criteria1:="1"
ActiveSheet.Protect
The sheet name "1000" is only applicable in one workbook, in another workbook the number scheme may change to "6001" as an example.
I would rather have my macro refer to a key to lookup the tab name, than actually hardcode the tab names in the macro.
For example, I have a tab called "Departments", and cells A1:A19 contain the department code that also corresponds to the tab names in each of the workbooks. I would prefer the macro pull the tab names from here, so that when I copy this workbook out I can change the "Departments" tab instead of the macro.
Thank you in advance for your help.