Parse value out of string for later use

loves_automation

New Member
Joined
Feb 21, 2002
Messages
7
Right now, I am trying to create a macro which will pull the date out of a string of text found in a cell and save the workbook the value of the cell in A1 plus the date.

So, for instance, I have the following text in cells A1 and A2, respectively:
Total Education
Structure Build Time:02/15/2002 04:57:00 AM

What I would like to do is to save the file as "Total Education 02.15.02" (note the date format I'd like to save the file as is slightly different than that of the formatting in the original cell). I know how to save a file with the value of cell A1 from one of your other articles, so I guess my question is, how can I parse the date out of cell A2 into a variable so that I can use it when saving the workbook?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
In C1 enter: =A1&TEXT(RIGHT(B1,LEN(B1)-SEARCH(":",B1))+0," mm.dd.yy")

where A1 houses values like "Total Education" and B1 values like "Structure Build Time:02/15/2002 04:57:00 AM".

Copy down the formula as far as needed.
 
Upvote 0

Forum statistics

Threads
1,213,514
Messages
6,114,078
Members
448,547
Latest member
arndtea

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