I have a routine that copies the contents of one workbook sheet onto another. Sometimes the source workbook sheet is named "Export", sometimes it is named "Data".
How can I code this so that the data from the source workbook sheet is always copied, regardless if the sheet is named "Export" or "Data"
Here is my code...it will copy the data from a sheet named "Export"
Set currentworkbook = ThisWorkbook
Set sourceworkbook = Workbooks.Open(RQTReport)
sourceworkbook.Sheets("Export").Copy before:=currentworkbook.Sheets("QuoteTemplate")
How can I code this so that the data from the source workbook sheet is always copied, regardless if the sheet is named "Export" or "Data"
Here is my code...it will copy the data from a sheet named "Export"
Set currentworkbook = ThisWorkbook
Set sourceworkbook = Workbooks.Open(RQTReport)
sourceworkbook.Sheets("Export").Copy before:=currentworkbook.Sheets("QuoteTemplate")