zenjah
01-30-2017, 05:45 PM
Hi there
I have a code that copies filtered data from various source files and pastes into a master workbook
for the copying part the codes are provided below
wb.Sheets("zzz").Columns("A:AA").EntireColumn.Hidden = False
wb.Sheets("zzz").Range("A3", Range("AA3").End(xlDown)).Copy
however, this only works when the source spreadsheet has the "zzz" tab being the active tab
if for example "yyy" was the active tab when the source spreadsheet was saved it will come up with an error message instead
I think this can be resolved by adding
wb.Sheets("***").Activate
but is there any better way to do this?
thanks for your help
I have a code that copies filtered data from various source files and pastes into a master workbook
for the copying part the codes are provided below
wb.Sheets("zzz").Columns("A:AA").EntireColumn.Hidden = False
wb.Sheets("zzz").Range("A3", Range("AA3").End(xlDown)).Copy
however, this only works when the source spreadsheet has the "zzz" tab being the active tab
if for example "yyy" was the active tab when the source spreadsheet was saved it will come up with an error message instead
I think this can be resolved by adding
wb.Sheets("***").Activate
but is there any better way to do this?
thanks for your help