i have a problem... one that im sure th answer is easy im just not seeing it. i am a fairly novice coder, so i do go about things the long way until i can at least get that down befor i move to more advanced stuff.
The problem i am having.. is you see the y all the way at the bottom, i know that doesn't work.. just im not sure how to define it so that it displays the worksheet funtion i set it too.
any help would be much appreciated.
Code:
Sub copy_into_window()
'
' Macro7 Macro
' Macro recorded 18/01/2005 by Nick Kotila
'
'
Let x = 1
Let y = ""
Do Until x = 23
If x = 1 Then y = Windows("Hamilton Epicenter.xls").Activate
If x = 2 Then y = Windows("L'assomption Epicenter.xls").Activate
If x = 3 Then y = Windows("Laval Epicenter.xls").Activate
If x = 4 Then y = Windows("Longueuil Epicenter.xls").Activate
If x = 5 Then y = Windows("Mirabel Epicenter.xls").Activate
If x = 6 Then y = Windows("Montreal Epicenter.xls").Activate
If x = 7 Then y = Windows("Montreal-Nord Epicenter.xls").Activate
If x = 8 Then y = Windows("Montreal-West Epicenter.xls").Activate
If x = 9 Then y = Windows("Repentinguy-Le Gardeur Epicenter.xls").Activate
If x = 10 Then y = Windows("Saint-Jean-sur-Richelieu Epicenter.xls").Activate
If x = 11 Then y = Windows("Ste Dorthee Epicenter.xls").Activate
If x = 12 Then y = Windows("St-Eustache Epicenter.xls").Activate
If x = 13 Then y = Windows("St-Hubert Epicenter.xls").Activate
If x = 14 Then y = Windows("Stoney Creek Epicenter.xls").Activate
If x = 15 Then y = Windows("Terrebonne Epicenter.xls").Activate
If x = 16 Then y = Windows("Victoriaville Epicenter.xls").Activate
If x = 17 Then y = Windows("Granby Epicenter.xls").Activate
If x = 18 Then y = Windows("Cowansville Epicenter.xls").Activate
If x = 19 Then y = Windows("Chomedy Epicenter.xls").Activate
If x = 20 Then y = Windows("Boisbriand Epicenter.xls").Activate
If x = 21 Then y = Windows("Auteuil Epicenter.xls").Activate
If x = 22 Then y = Windows("Ancaster Waterdown Dundus Epicenter.xls").Activate
Windows("NEWSALESLIST.XLS").Activate
Cells.Select
Selection.copy
y
Sheets("Sheet2").Select
Cells.Select
ActiveSheet.Paste
Application.Run "PERSONAL.XLS!Copydata"
Let x = x + 1
Loop
The problem i am having.. is you see the y all the way at the bottom, i know that doesn't work.. just im not sure how to define it so that it displays the worksheet funtion i set it too.
any help would be much appreciated.