A
Anders
Hi All,
I'm having trouble with the following macro. I need to get the "copy
milestones" to run in the file I open and paste into the worksheet I created.
Currently, the macro is copying from the newly created workbook. The sheet
I open will always have a different name so I can't refer to it by sheetname.
How do I make the embedded macro run on the file I select to open?
TIA,
Anders
Sub GetData44()
Set NewBook = Workbooks.Add
With NewBook
ActiveSheet.Name = "Milestone Exceptions"
End With
Set bswks = ActiveSheet
Dim str As String
str = Application.GetOpenFilename
Application.Run ("Copy_Milestones2")
bswks.Activate
Range("a1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
The "Copy Milestones" it refers to is the following:
Sub Copy_Milestones(
Range("A82:j119,A193:j230,A304:J341,A415:J452,A526:J563,A637:J674,A748:J785,A859:J896,A970:J1007,A1081:J1118,A1192:J1229,A1303:J1340,A1411:J1451,A1525:J1562").Copy
End Sub
I'm having trouble with the following macro. I need to get the "copy
milestones" to run in the file I open and paste into the worksheet I created.
Currently, the macro is copying from the newly created workbook. The sheet
I open will always have a different name so I can't refer to it by sheetname.
How do I make the embedded macro run on the file I select to open?
TIA,
Anders
Sub GetData44()
Set NewBook = Workbooks.Add
With NewBook
ActiveSheet.Name = "Milestone Exceptions"
End With
Set bswks = ActiveSheet
Dim str As String
str = Application.GetOpenFilename
Application.Run ("Copy_Milestones2")
bswks.Activate
Range("a1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
The "Copy Milestones" it refers to is the following:
Sub Copy_Milestones(
Range("A82:j119,A193:j230,A304:J341,A415:J452,A526:J563,A637:J674,A748:J785,A859:J896,A970:J1007,A1081:J1118,A1192:J1229,A1303:J1340,A1411:J1451,A1525:J1562").Copy
End Sub