I'm trying to set two different workbooks so that VBA can distinguish between the two.
I have named one CurrentWB which is the workbook I'm currently using and creating the Sub for, and the other ComponentWB which is the workbook I intend to extract data from.
I have set CurrentWB as ThisWorkbook and have set ComponentWB as "Component Data.xlsx", which is the name of the component workbook.
However, when I step through the code it keeps setting ComponentWB as ThisWorkbook also. Does anyone have any ideas why?
The ComponentWB is not the workbook I am writing the code in so I'm unsure why it is setting as ThisWorkbook, especially when I have told it to set to "Component Data.xlsx"
Any help would be appreciated,
Thank you
I have named one CurrentWB which is the workbook I'm currently using and creating the Sub for, and the other ComponentWB which is the workbook I intend to extract data from.
I have set CurrentWB as ThisWorkbook and have set ComponentWB as "Component Data.xlsx", which is the name of the component workbook.
However, when I step through the code it keeps setting ComponentWB as ThisWorkbook also. Does anyone have any ideas why?
The ComponentWB is not the workbook I am writing the code in so I'm unsure why it is setting as ThisWorkbook, especially when I have told it to set to "Component Data.xlsx"
Any help would be appreciated,
Thank you