Vba Convert Date value from 8/7/19 to August 7, 2019

zoog25

Active Member
Joined
Nov 21, 2011
Messages
418
Hello All,

Here is my situation, i'm using excel vba on a spreadsheet. All the values of column K are in mm/dd/yy ie (8/7/19). Now i have made a macro that take information from this sheets and fills a few word documents. My problem is that they now want the documents to display the full calendar date (ie August 7, 2019). How would i go about doing this. So far here is what i have

Code:
NOCdate = NOCws.Cells(Target, "K").Value

Wordapp.ActiveDocument.FormFields("TXCompletionDate").Result = NOCdate

How can i convert the date entered into NOCdate to the format Month Date, Year or August 7, 2019.

Thank you.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
If it is possible to use a 'helper' column, I'd reformat the date in another column =text(Ref, "Mmmm D, YYYY") and have your macro reference the new column.
Ref = the current date column

If a helper column is not an option, the current column is a formula and adjusting the current column would not impact any other formula, you could use the same formula but
Ref = current formula

HTH
 
Upvote 0
Try this.
Code:
Wordapp.ActiveDocument.FormFields("TXCompletionDate").Result = Format(NOCdate, "mmmm dd, yyyy")
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,126
Members
453,021
Latest member
Justyna P

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