Use a date selected from a calender to match to a portion of the file name which I need to import daily as the source of my macro?

mammaleoni

New Member
Joined
Dec 12, 2014
Messages
1
How do I use a date selected from a calender to match to a portion of the file name which I need to import daily as the source of my macro?

I am very new to VB , I have recorded a macro to open a file from a shared folder and then do various actions from there, which are working fine on the day , however i'd like to have a calender on a form and select the date from the calender and then within the macro it needs to match this selected date to the file containing that date as a part of the file name?:confused:

Sub Macro2()
'
' Macro2 Macro
'
'
ChDir "R:\CASDM\Collateral\Collateral Register"
Workbooks.Open Filename:= _
"R:\CASDM\Collateral\Collateral Register\Collateral Register 2014-12-12-01-18-54.XLS"
End Sub
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,215,223
Messages
6,123,715
Members
449,118
Latest member
MichealRed

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