I am new to VBA and am trying to create a copy of a sheet from one workbook to another workbook using the following code:
Workbooks.Open Filename:=bw_path & "\" & bw_file
'Opening the file from which I want to copy.
Sheets(bw_sh).Copy After:=ThisWorkbook.Sheets(3)
'Trying to copy the open worksheet into the workbook housing the macro.
I am getting the "subscript out of range" error message. I inherited this code and it used to work before. What am I doing wrong and what would be a suggested solution Any help will be appreciated