textbox formula outside procedure

B

bg18461

I am trying to have a textbox just show todays date. The only problem
am having is having this done outside a procedure. I dont want th
user to have to push a button or select a box, I simply want wheneve
the user opens the workbook, this particular cell to just show today
date. I tried to enter the formula: TextBox18 = Format(Date
"MM/DD/YYYY") in the general portion of of vba sheet (declarations) bu
i get outside procedure compile error, any hints..
 
C

Chip Pearson

Try something like in the ThisWorkbook code module:

Sub Workbook_Open()
Worksheets("Sheet1").Textbox18.Value =
Format(Now,"mm/dd/yyyy")
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
F

Frank Kabel

Hi
you may have to change the Textbox reference and the sheet reference to
your spreadsheet settings. e.g. change 'Textbox18' to your textbox name
 
Top