I
iashorty
I need to switch between 3 Open windows but two of them have variable names.
Wkbk1=macros resides here and the cells having the names of the other two
workbooks is on a sheet in this workbook
Wkbk2=the main workbook is being done in this workbook. Wkbk1 only has the
macro.
Wkbk2=this workbook has information to be copied into Wkbk2
Within Wkbk1:
Set Wkbk2 = Sheets("D Tab").Range("B11") (this cell has both the path and
Wkbk2 name)
Set Wkbk3 = Sheets("D Tab").Range("B35") (this cell has both the path and
Wkbk2 name)
Set Wkbk2Win= Sheets("D Tab").Range("B12") This cell has just the file name
in it.
Set Wkbk3Win= Sheets("D Tab").Range("B36") This cell has just the file name
in it.
The macro opens the workbooks correctly. But when I try to copy from Wkbk3
to Wkbk2, I cannot activate Wkbk2 to place the information in the proper
place. And, I suppose I will have trouble moving back to Wkbk3 when I need to
do more work there.
Here is where I am. I opened Wkbk1 and started the macro. The macro opens
Wkbk2 and prepares it for receiving the information from Wkbk3. The macro
then opens Wkbk3. The macro selects the information and copies it. At this
point I tried the following code:
Windows(Wkbk2Win).Activate
Wkbk1=macros resides here and the cells having the names of the other two
workbooks is on a sheet in this workbook
Wkbk2=the main workbook is being done in this workbook. Wkbk1 only has the
macro.
Wkbk2=this workbook has information to be copied into Wkbk2
Within Wkbk1:
Set Wkbk2 = Sheets("D Tab").Range("B11") (this cell has both the path and
Wkbk2 name)
Set Wkbk3 = Sheets("D Tab").Range("B35") (this cell has both the path and
Wkbk2 name)
Set Wkbk2Win= Sheets("D Tab").Range("B12") This cell has just the file name
in it.
Set Wkbk3Win= Sheets("D Tab").Range("B36") This cell has just the file name
in it.
The macro opens the workbooks correctly. But when I try to copy from Wkbk3
to Wkbk2, I cannot activate Wkbk2 to place the information in the proper
place. And, I suppose I will have trouble moving back to Wkbk3 when I need to
do more work there.
Here is where I am. I opened Wkbk1 and started the macro. The macro opens
Wkbk2 and prepares it for receiving the information from Wkbk3. The macro
then opens Wkbk3. The macro selects the information and copies it. At this
point I tried the following code:
Windows(Wkbk2Win).Activate