iainmartin100
New Member
- Joined
- Mar 9, 2011
- Messages
- 43
I think this one should be really easy but I just can't work it out after searching for hours i'll admit I need help.
I have two excel documents, for ease of explaining I will call them: Download_List & Master_Document.
all I need to do is create a macro which works from Master_Document and opens Download_List, copies 2 tabs from Download_List and paste values into the Master_Document then closes Download_List.
This is really easy but then I came across the problem which was that the names of both workbooks would change on a daily basis so I need excel to remember what file name/path is selected for the Download_List and for it also to know what file is the Master_Document (File the Macro is saved in).
Here's the code I have so far,
Anything in Green is a file name which needs to be remembered by Excel rather than me typing it in.
Sub Refresh_IDeaS_Data()
'
' Refresh_IDeaS_Data Macro
' Macro recorded 09/03/2011 by IPM
'
'
Application.Dialogs(xlDialogOpen).Show - Opens Download_List.xls
Sheets("Hotel").Select
Range("A2:DV366").Select
Selection.Copy
Windows("Master_Document.xls").Activate
Sheets("Hotel_DL").Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("Download_List.xls").Activate
Sheets("MS Groups").Select
Range("A2:AF5111").Select
Selection.Copy
Windows("Master_Document.xls").Activate
Sheets("MSGroups_DL").Select
Range("B2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Information").Select
How needs to close Download_List.xls
End Sub
If anyone can be of help this would be greatly appricated.
Thanks, Iain
I have two excel documents, for ease of explaining I will call them: Download_List & Master_Document.
all I need to do is create a macro which works from Master_Document and opens Download_List, copies 2 tabs from Download_List and paste values into the Master_Document then closes Download_List.
This is really easy but then I came across the problem which was that the names of both workbooks would change on a daily basis so I need excel to remember what file name/path is selected for the Download_List and for it also to know what file is the Master_Document (File the Macro is saved in).
Here's the code I have so far,
Anything in Green is a file name which needs to be remembered by Excel rather than me typing it in.
Sub Refresh_IDeaS_Data()
'
' Refresh_IDeaS_Data Macro
' Macro recorded 09/03/2011 by IPM
'
'
Application.Dialogs(xlDialogOpen).Show - Opens Download_List.xls
Sheets("Hotel").Select
Range("A2:DV366").Select
Selection.Copy
Windows("Master_Document.xls").Activate
Sheets("Hotel_DL").Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("Download_List.xls").Activate
Sheets("MS Groups").Select
Range("A2:AF5111").Select
Selection.Copy
Windows("Master_Document.xls").Activate
Sheets("MSGroups_DL").Select
Range("B2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Information").Select
How needs to close Download_List.xls
End Sub
If anyone can be of help this would be greatly appricated.
Thanks, Iain