Opening Specific Excel File

wasabiDev

New Member
Joined
Feb 5, 2018
Messages
6
I need to open a folder with the name "File_Name_23Jan18" in that format.The Date changes everyday. Also, can i open the file with just the "File_Name"? Any help would do thanks.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
your question is not clear , could explain what do you want to do exactly ? you want to open folder or an excel file with this name ? and you want the name of the folder changes everyday ?
 
Upvote 0
So sorry, i didnt mean folder. What i mean is that i have an excel file name "File_Name_23Jan18" in that format, and the date on that file name changes everyday. for example, the date today is february 5. So the name of the file would be "File_Name_5Feb18". and tomorrow it would be "File_Name_6Feb18" how would i be able to open it using macro?

your question is not clear , could explain what do you want to do exactly ? you want to open folder or an excel file with this name ? and you want the name of the folder changes everyday ?
 
Upvote 0
You can use date to get todays date and format it to match the file name.

Code:
mydate = Format(Date, "dmmmyy")
Workbooks.Open "C:\yourpath\File_Name_" & mydate & ".xlsx"
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top