Add text based on date in another cell

MHamid

Active Member
Joined
Jan 31, 2013
Messages
472
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hello,

I was wondering if this was possible to do in vba code.

I have a date in cell A15 and A16 ... 3/31/18 and 2/28/18 respectively. In the cells next to the date I need text that will pull the year and then some instr text or it can all be instr. I'm looking to type a file name like "2018_AA_BBBB_2018_04_17_V1.1_(Mar_Final).xlsm". The important information in the file name is the year, which I'd like to be pulled from the dates in A15 and A16, and the words "(Mar_Final).xlsm". Year, dates, and versions will vary.

Column A Column B
3/31/2018 2018_AA_BBBB_2018_04_17_V1.1_(Mar_Final).xlsm
2/28/2018 2018_AA_BBBB_2018_03_13_V1.2_(Feb_Final).xlsm

My goal is to be able to pull particular data from these files. So I just thought that it would be easier to have the file name (even if it's not exact and just an instr function) and then some kind of code that will open the file name in that cell and then do a vlookup to bring back the data that is needed.

Is this possible?

Thank you
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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