Nicolaf
09-13-2012, 08:59 AM
Hi,
I need to go into a workbook (called BookFilter.xls) select a name in a dropdown filter, copy the data and paste it into another workbook (called BookData.xls).
The code I have saved is the following:
Workbooks.Open Filename:= _
"C:\WINDOWS\Desktop\BookFilter.xls"
Application.Run "BLPLinkReset"
Application.Run "ConnectChartEvents"
Selection.AutoFilter Field:=1, Criteria1:="Spain"
Range("C8:D8").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
ActiveWindow.Close
Application.Run "BLPLinkReset"
Range("A4").Select
ActiveSheet.Paste
Range("A8").Select
End Sub
So the Criteria in the dropdown filter for my selection is Spain.
If I wanted to make the criteria equal to the text in cell A1 of BookData.xls (Spain or whatever other country we choose) how would I change my code?
:dunno :doh:
Nic
I need to go into a workbook (called BookFilter.xls) select a name in a dropdown filter, copy the data and paste it into another workbook (called BookData.xls).
The code I have saved is the following:
Workbooks.Open Filename:= _
"C:\WINDOWS\Desktop\BookFilter.xls"
Application.Run "BLPLinkReset"
Application.Run "ConnectChartEvents"
Selection.AutoFilter Field:=1, Criteria1:="Spain"
Range("C8:D8").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
ActiveWindow.Close
Application.Run "BLPLinkReset"
Range("A4").Select
ActiveSheet.Paste
Range("A8").Select
End Sub
So the Criteria in the dropdown filter for my selection is Spain.
If I wanted to make the criteria equal to the text in cell A1 of BookData.xls (Spain or whatever other country we choose) how would I change my code?
:dunno :doh:
Nic