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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
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,214,956
Messages
6,122,465
Members
449,085
Latest member
ExcelError

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