Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default textbox formula outside procedure

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..

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default textbox formula outside procedure

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




"bg18461 " wrote in
message ...
I am trying to have a textbox just show todays date. The only

problem i
am having is having this done outside a procedure. I dont want

the
user to have to push a button or select a box, I simply want

whenever
the user opens the workbook, this particular cell to just show

todays
date. I tried to enter the formula: TextBox18 = Format(Date,
"MM/DD/YYYY") in the general portion of of vba sheet

(declarations) but
i get outside procedure compile error, any hints...


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default textbox formula outside procedure

I get a 'subscript out of range' error.


---
Message posted from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default textbox formula outside procedure

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

--
Regards
Frank Kabel
Frankfurt, Germany

"bg18461 " schrieb im
Newsbeitrag ...
I get a 'subscript out of range' error.


---
Message posted from http://www.ExcelForum.com/


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop a Procedure from another procedure Ayo Excel Discussion (Misc queries) 1 October 30th 08 01:42 AM
Formula in TextBox reno Excel Discussion (Misc queries) 0 July 2nd 07 03:38 PM
What is procedure to exit formula auditing mode? W8 Excel Discussion (Misc queries) 3 February 14th 05 08:05 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 12:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"