VBA to Enter String (Constant) and Last Day of Previous Month

Hollando

Board Regular
Joined
Sep 13, 2012
Messages
55
Hello all,

Trying to figure out how I can wing this last thing for a tool I'm building.

Basically in cell A1 I need to enter this string "'Gadgets Sales ending' September 30 2013" (September 30 2013 being the variable).

Any thoughts on how I can accomplish this would be greatly appreciated.

Regards,

Hollando
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Does this do what you want?

="'Gadgets Sales ending' "&TEXT(TODAY()-DAY(TODAY()),"mmmm d yyyy")

If you did not really mean "previous month to today", then just substitute a cell containing a date for both of the TODAY() functions.
 
Upvote 0
Does this do what you want?

="'Gadgets Sales ending' "&TEXT(TODAY()-DAY(TODAY()),"mmmm d yyyy")

If you did not really mean "previous month to today", then just substitute a cell containing a date for both of the TODAY() functions.

Thanks for the quick response Rick. This worked great!
 
Upvote 0

Forum statistics

Threads
1,215,130
Messages
6,123,220
Members
449,091
Latest member
jeremy_bp001

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