automatic date change in VBA?

L

Legacy 237453

Guest
Hi

I need the following text in cell B:7 to change depending on the date.

"SAP F&R Poland Milestones for Tuesday the 9th of March 2013"

The thing is i need the date to read the date for the previous day? The reason being is that im reporting on the milestones for the previous day.
I guess im looking for a way to have the "Tuesday", "9th", "March" and "2013" to change automatically?

Thanks for reading!
Cheers
Craig
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Perhaps this.

="SAP F&R Poland Milestones for " & TEXT(TODAY()-1, "dddd d mmmm yyyy")

If you want the ordinals th, nd etc then there is a formula but I don't have it handy.

Found it.

="SAP F&R Poland Milestones for "&SUBSTITUTE(TEXT(TODAY()-1,"dddd ""the"" dzz mmmm yyyy"),"zz",MID("thstndrdth",MIN(9,2*RIGHT(DAY(TODAY()-1))*(MOD(DAY(TODAY()-1)-11,100)>2)+1),2))
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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