Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to insert a Quick Text date (the date always shows the current date or the date the document is printed) inside a Text Box in Excel 2010 and am not finding any Quick Text options inside Excel.

I know I could do this in this particular file by changing this particular text box into text inside some cells. It would work this way then using the various date functions in Excel formulas.

However, I'd like to know if it is possible, and if so, how to use quick text inside a text box in Excel.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Use the macro recorder to insert a text box and type anything whatsover into it. Stop the recorder. Open the VB editor (alt-F11 will do it). Cut the recorded macro from the module and paste it in the sheet object module. In that module there will be a few dropdown boxes. Use the one that reads "General" and change it to "Worksheet". Then use the dropdown to the right of it to pick "sheet_activate" or "before_print", or do both. I'm on linux now so I can't do a quick look, but you may have to use "Workbook" module to get the "before_print" event. When you pick these things, a stub of code is inserted. You'll use the macro you recorded as a template for code you put in the stubs. Get familiar with the functions Now(), Date(), and Format(). You'll also have to figure out it you can replace the text in an existing textbox or destroy and recreate it everytime. Sorry this is more a hint than a how-to. It should be easy to do. If google and a little persistence doesn't yield the desired result, post a comment here. I can show you the whole code to do it. Traveling Sep 7 so won't respond that day. Good Luck.

share|improve this answer
    
I hadn't thought of using macros to do it. But I've worked with enough to be able to figure that out based on your details here. Thanks for the answer. I've gone ahead and just used a normal cell and formatting to make it look the way I want. But going forward, this should work pretty well. –  music2myear Sep 6 '11 at 14:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.