Hi,
Hi,
I am trying to activate a window once I have opened the workbook with a macro.
The main aim is to open the workbook 2 and then go back to workbook 1, look up the sheet iI want it to copy as the sheet name always changes, go to workbook 2 and copy and bring the worksheet back into workbook 1.
Sheets("Front Page").Select
Range("A3").Select
ActiveCell.CurrentRegion.Select
For Each i In Selection
myvalue = i.Value
myworkbook = "\\x:\data\workbooksfolder\" & myvalue & ".xls"
Workbooks.Open Filename:=myworkbook
Next
not sure how to do this part -
Windows("UT MI.xls").Activate
If Worksheets("Front Page").Range("C3").Value Then
Window.Activate = "\\x:\data\workbooksfolder\" & myvalue & ".xls"
Worksheets("Front Page").Range("C3").activate
Else
End If
Many thanks.
Hi,
I am trying to activate a window once I have opened the workbook with a macro.
The main aim is to open the workbook 2 and then go back to workbook 1, look up the sheet iI want it to copy as the sheet name always changes, go to workbook 2 and copy and bring the worksheet back into workbook 1.
Sheets("Front Page").Select
Range("A3").Select
ActiveCell.CurrentRegion.Select
For Each i In Selection
myvalue = i.Value
myworkbook = "\\x:\data\workbooksfolder\" & myvalue & ".xls"
Workbooks.Open Filename:=myworkbook
Next
not sure how to do this part -
Windows("UT MI.xls").Activate
If Worksheets("Front Page").Range("C3").Value Then
Window.Activate = "\\x:\data\workbooksfolder\" & myvalue & ".xls"
Worksheets("Front Page").Range("C3").activate
Else
End If
Many thanks.
