Reference a sheet that i want to select and copy when using indirect funtion

richieH

New Member
Joined
Jan 22, 2018
Messages
3
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

 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top