Hi everybody, I am very new to VB and this might be a really easy question but here goes-
I have taken over this project for somebody who left and had already written a lot of the code for it. Currently the macro has our data being imported into one worksheet. I was wondering if there was an easy way to make it so that it would also import this same data into another workbook. The code looks something like this...
Sub import()
Cells.Select
Selection.ClearContents
Range("A1").Select
ChDir "g:\finance\2004\analysis\compete\Cs-54\CS54 Files - Escanaba Excluded\Competitive"
Workbooks.Open FileName:="g:\finance\2004\analysis\compete\Cs-54\CS54 Files - Escanaba Excluded\Competitive\carloadsdone.XLS"
ActiveWindow.WindowState = xlNormal
With ActiveWindow
.Top = 69.25
.Left = 17.5
End With
Cells.Select
Selection.Copy
Windows("Cs54mstr (E).xls").Activate
ActiveSheet.Paste
Application.CutCopyMode = False
Windows("carloadsdone.XLS").Activate
With ActiveWindow
.Top = 68.5
.Left = -40.25
End With
ActiveWindow.Close
ActiveWindow.WindowState = xlMaximized
Range("A2").Select
End Sub
**Anyways, instead of the file only going to Cs54mstr (E).xls I was wondering what I would have to do to make it also go to an empty workbook called competition.xls.
Any help would be much appreciated
Thanks a lot for your time,
Phil
I have taken over this project for somebody who left and had already written a lot of the code for it. Currently the macro has our data being imported into one worksheet. I was wondering if there was an easy way to make it so that it would also import this same data into another workbook. The code looks something like this...
Sub import()
Cells.Select
Selection.ClearContents
Range("A1").Select
ChDir "g:\finance\2004\analysis\compete\Cs-54\CS54 Files - Escanaba Excluded\Competitive"
Workbooks.Open FileName:="g:\finance\2004\analysis\compete\Cs-54\CS54 Files - Escanaba Excluded\Competitive\carloadsdone.XLS"
ActiveWindow.WindowState = xlNormal
With ActiveWindow
.Top = 69.25
.Left = 17.5
End With
Cells.Select
Selection.Copy
Windows("Cs54mstr (E).xls").Activate
ActiveSheet.Paste
Application.CutCopyMode = False
Windows("carloadsdone.XLS").Activate
With ActiveWindow
.Top = 68.5
.Left = -40.25
End With
ActiveWindow.Close
ActiveWindow.WindowState = xlMaximized
Range("A2").Select
End Sub
**Anyways, instead of the file only going to Cs54mstr (E).xls I was wondering what I would have to do to make it also go to an empty workbook called competition.xls.
Any help would be much appreciated
Thanks a lot for your time,
Phil