Can anyone help please, I am trying to reference a value at A1 on a sheet in my current workbook called Tabnames from white book which contains the dynamic name of the extracted sheet names from the open white book. But i am struggling with the correct syntax as i keep getting an error when running VBA.
The red highlight of the code is what i am trying to write but i can't work out how to incorporate the indirect function. the section in blue works but i have to change the code to the sheet
name for this to work.
I have written a code for extracting the sheet names in to a worksheet 'Tab names from White Book' to then use this as a reference for the sheet name. I can;t use sheet numbers or code name as they will not always be the same same with the sheet name
Workbooks.Open Filename:= _
"D:\Projects\ASE Templates\ASE Template White Book.xlsx"
Application.Left = 192.25
Application.Top = 1
Sheets("Indirect('[ASE RTU Addressing with Automation.xlsm]' & ""'Tab Names from white book'"" & ""!A1"")).Select"
Sheets("2S0 P143 MAIN BUS SECTION").Copy After:=Workbooks( _
"ASE RTU Addressing with Automation.xlsm").Sheets(4)
Windows("ASE Template White Book.xlsx").Activate
Sheets("9L5 P143 CAMSTER").Select
Sheets("9L5 P143 CAMSTER").Copy After:=Workbooks( _
"ASE RTU Addressing with Automation.xlsm").Sheets(5)
Thank you for your help
The red highlight of the code is what i am trying to write but i can't work out how to incorporate the indirect function. the section in blue works but i have to change the code to the sheet
name for this to work.
I have written a code for extracting the sheet names in to a worksheet 'Tab names from White Book' to then use this as a reference for the sheet name. I can;t use sheet numbers or code name as they will not always be the same same with the sheet name
Workbooks.Open Filename:= _
"D:\Projects\ASE Templates\ASE Template White Book.xlsx"
Application.Left = 192.25
Application.Top = 1
Sheets("Indirect('[ASE RTU Addressing with Automation.xlsm]' & ""'Tab Names from white book'"" & ""!A1"")).Select"
Sheets("2S0 P143 MAIN BUS SECTION").Copy After:=Workbooks( _
"ASE RTU Addressing with Automation.xlsm").Sheets(4)
Windows("ASE Template White Book.xlsx").Activate
Sheets("9L5 P143 CAMSTER").Select
Sheets("9L5 P143 CAMSTER").Copy After:=Workbooks( _
"ASE RTU Addressing with Automation.xlsm").Sheets(5)
Thank you for your help