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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
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,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

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