I have a Macro that opens (2) Workbooks.
The 1st is an Input data Workbook from a .tsv file.
The Macro then Copys a Series of Cells and Colums into the 2nd.
This process is repeated switching between workbooks until completed.
I need the 1st Workbook to be User Selected,(I am currently using the Application.GetOpenFilename) to do this.
When the Macro has completed I need the Second Workbookds to be saved to a User Defined Filename and Folder. The Application.GetSaveAsFilename should work fine fo this part. I just haven't gotten things to work that far yet to confirm it.
I am having difficulities assiging the 1st File to a Variable that can be referenced throughout the Macro.
Browsing to and Opening the File is easy it is the referencing it in the statement that switches between the Open workbooks:
Windows("FileToOpen").activate
That is giving me troubles. How do I set the file I opened to a variable to be referenced in the statement above?
Here is a Sample of the Code that switched back and forth:
Windows("FileToOpen").Activate
Range("D7:D41").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MT_PresetTemplate_880.xlsx").Activate
Range("U65").Select
ActiveSheet.Paste
Windows("FileToOpen").Activate
Range("F7:F41").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MT_PresetTemplate_880.xlsx").Activate
Range("W65").Select
ActiveSheet.Paste
Windows("FileToOpen").Activate
Range("C42").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MT_PresetTemplate_880.xlsx").Activate
Range("W103").Select
ActiveSheet.Paste
Any help with this would be great