Link to home
Start Free TrialLog in
Avatar of Jagwarman
Jagwarman

asked on

move between two open excel files when one contains a date

I am pretty new to this stuff and have hit a brick wall.

I have a file that is open in my window The file name is 16112012.xls [which is today's date]

I open another file [lets call it Steve.xls] Copy Cells A1:D4 then I want to go back to my file 16112012.xls [Note this changes every day so tomorrow it will be called 17112012.xls etc.]

I figured I use the code:  Windows("today_" & Format(Date, "ddmmmyyyy") & ".xls").Activate to take me back to the file 16112012.xls but it comes up with an error

Run-Time Error '9' Subscript out of range.

Appreciate any help in resolving this
Thanks
ASKER CERTIFIED SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
or maybe you should try

application.workbooks(Format(Date, "ddmmmyyyy") & ".xls").Activate
Or try Windows(format(Today(),"ddmmyyyy").Activate

Cheers...
Terry
Avatar of Jagwarman
Jagwarman

ASKER

Brilliant thanks very much.