Vba code to open file which has current date in its name

aman2059

Board Regular
Joined
Jan 17, 2016
Messages
75
Hi All,

I am working on one vba coding and I am stucked in between and wanted help.

Through the macro, I want one file to be opened from the given location and the name of the file is in below format.

"LearnersinMandateDataExport_3657_11302015.xlsx"

In the above format only date changes every time and it would always be current date. for example - if I am running macro today. It would always contain the above name with the current date (mmddyyy). given as below for today

"LearnersinMandateDataExport_3657_01192016.xlsx"

I tried somewhat below.

"Workbooks.Open Filename:= _
"C:\Raw Data\" & Format("LearnersinMandateDataExport_3657_""mmddyyyy"")"

Thank you in advance for help.
 
Hello, I want to write VBA code to open excel file with Path name as date (eg- CM\data\05_2020\) and excel file name(SD Amount_14.05.2020) with date which is todays date in both cases

Pls help me...
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hello, I want to write VBA code to open excel file with Path name as date (eg- CM\data\05_2020\14.05.2020 ) and excel file name(SD Amount_14.05.2020) with date which is today's date in both cases

Pls help me...
 
Upvote 0

Forum statistics

Threads
1,216,082
Messages
6,128,713
Members
449,464
Latest member
againofsoul

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