Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to get an automatic date or time into a userform. Can someone help
me with this. -- Thanks, Marjan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Userform_Activate()
label1.Caption = format(now,"mm/dd/yyyy hh:mm") End sub if you want it to update periodically, look at Chip Pearson's page on the use of OnTime. You could start it off in the activate event. http://www.cpearson.com/excel/ontime.htm -- Regards, Tom Ogilvy "marjan" wrote in message ... I'm trying to get an automatic date or time into a userform. Can someone help me with this. -- Thanks, Marjan |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When I use this option users can not adjust this cell. How can I get it
adjustable. -- Thanks, Marjan "Tom Ogilvy" wrote: Private Sub Userform_Activate() label1.Caption = format(now,"mm/dd/yyyy hh:mm") End sub if you want it to update periodically, look at Chip Pearson's page on the use of OnTime. You could start it off in the activate event. http://www.cpearson.com/excel/ontime.htm -- Regards, Tom Ogilvy "marjan" wrote in message ... I'm trying to get an automatic date or time into a userform. Can someone help me with this. -- Thanks, Marjan |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use a textbox instead:
Private Sub Userform_Activate() Textbox1.Value = format(now,"mm/dd/yyyy hh:mm") End sub "marjan" wrote in message ... When I use this option users can not adjust this cell. How can I get it adjustable. -- Thanks, Marjan "Tom Ogilvy" wrote: Private Sub Userform_Activate() label1.Caption = format(now,"mm/dd/yyyy hh:mm") End sub if you want it to update periodically, look at Chip Pearson's page on the use of OnTime. You could start it off in the activate event. http://www.cpearson.com/excel/ontime.htm -- Regards, Tom Ogilvy "marjan" wrote in message ... I'm trying to get an automatic date or time into a userform. Can someone help me with this. -- Thanks, Marjan |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() If you're wanting your DTPicker (or whatever you're using) to default to the current date, you can use the following code: Private Sub UserForm_Initialize() dtpDate.Value = Now End Sub HTH DejaVu -- DejaVu ------------------------------------------------------------------------ DejaVu's Profile: http://www.excelforum.com/member.php...o&userid=22629 View this thread: http://www.excelforum.com/showthread...hreadid=376111 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have made use this line of code:-
Textbox1.Value = format(now,"mm/dd/yyyy") to complete a textbox in a UserForm, however it only works for me some people on my team it seems. For others it brings up a Compile Error 'can't find Project or library..??? Is this anything to do with Addins or Excel options? I have also used:- Textbox1.Value = Date but the effect seems to be the same. Can anybody help me understand why? or can I fill the textbox from a single cell on a sheet (with ' =Today() ' in the cell)? I know this is an old thread but it shows that I do search for an answer before posting ;-) Thank you in advance Damon "Tom Ogilvy" wrote: Use a textbox instead: Private Sub Userform_Activate() Textbox1.Value = format(now,"mm/dd/yyyy hh:mm") End sub "marjan" wrote in message ... When I use this option users can not adjust this cell. How can I get it adjustable. -- Thanks, Marjan "Tom Ogilvy" wrote: Private Sub Userform_Activate() label1.Caption = format(now,"mm/dd/yyyy hh:mm") End sub if you want it to update periodically, look at Chip Pearson's page on the use of OnTime. You could start it off in the activate event. http://www.cpearson.com/excel/ontime.htm -- Regards, Tom Ogilvy "marjan" wrote in message ... I'm trying to get an automatic date or time into a userform. Can someone help me with this. -- Thanks, Marjan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Forms / Templates - automatic sending | Excel Discussion (Misc queries) | |||
Automatic Time and Date | Excel Worksheet Functions | |||
Automatic date and time updation | Excel Discussion (Misc queries) | |||
excel, automatic date and time when info gets entered | Excel Worksheet Functions | |||
Automatic Vlookups in Forms | Excel Programming |