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

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
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,831
Messages
6,127,142
Members
449,363
Latest member
Yap999

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