Hello,
I got a file to save as something and then it switches back to the file. This file will change each day because it has the days date in it. I want it to switch between two open windows then. The code I have, but it is not working is below.
The process: copy data from "wb 1" "sheet 1", create new workbook, paste data into sheet 1 of the new workbook, format data, save file as "wb 2 today's date" (wb 2 06/03/2011), go back to "wb 1", copy data from "wb 1" "sheet 2", select the newly saved workbook (wb 2 06/03/2011), and paste data into "wb 2" "sheet 2".
The main problem is switching between the two files.
To save the file (which works)-
Dim filetosave As String
Dim dir As String
dir = "C:\Users\squatr200\Desktop\Afternoon Reports\Metro E"
filetosave = Range("O29").Value & " " & Format(Now(), "mm-dd-yyyy")
switching between files
Windows("wb 2 & " " & Format(Now(), "mm-dd-yyyy")").Activate
I got a file to save as something and then it switches back to the file. This file will change each day because it has the days date in it. I want it to switch between two open windows then. The code I have, but it is not working is below.
The process: copy data from "wb 1" "sheet 1", create new workbook, paste data into sheet 1 of the new workbook, format data, save file as "wb 2 today's date" (wb 2 06/03/2011), go back to "wb 1", copy data from "wb 1" "sheet 2", select the newly saved workbook (wb 2 06/03/2011), and paste data into "wb 2" "sheet 2".
The main problem is switching between the two files.
To save the file (which works)-
Dim filetosave As String
Dim dir As String
dir = "C:\Users\squatr200\Desktop\Afternoon Reports\Metro E"
filetosave = Range("O29").Value & " " & Format(Now(), "mm-dd-yyyy")
switching between files
Windows("wb 2 & " " & Format(Now(), "mm-dd-yyyy")").Activate