Seamus2626
asked on
open file vba
Hi,
I have some code to open a file using VBA
ChDir "R:\ABC\Boris Info\Horis_Project\GBM\Dec -15\Flat Data Files"
Workbooks.Open Filename:= _
"R:\ABC\Boris Info\Horis_Project\GBM\Dec -15\Flat Data Files\Flat_GBM_ALL.xlsx"
ActiveWindow.ActivateNext
I have a drop down in cell D4 which has months Jan-16, Feb-16 etc
Instead of hardcoding Dec-15 like above, can the code use whatever value is in D4 so each month it selects the correct file
Thanks
I have some code to open a file using VBA
ChDir "R:\ABC\Boris Info\Horis_Project\GBM\Dec
Workbooks.Open Filename:= _
"R:\ABC\Boris Info\Horis_Project\GBM\Dec
ActiveWindow.ActivateNext
I have a drop down in cell D4 which has months Jan-16, Feb-16 etc
Instead of hardcoding Dec-15 like above, can the code use whatever value is in D4 so each month it selects the correct file
Thanks
you can use "R:\ABC\Boris Info\Horis_Project\GBM\"&R ange("D4") .value&"\F lat Data Files"
ASKER
getting the red errors when i paste that in place of dec-15
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect!
weldone Sktneer
Thanks Professor! :)
@Seamus2626
Thanks. Glad it worked for you.
@Seamus2626
Thanks. Glad it worked for you.