I'm trying to get an automatic date or time into a userform. Can someone help
me with this.
--
Thanks,
Marjan
I'm trying to get an automatic date or time into a userform. Can someone help
me with this.
--
Thanks,
Marjan
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
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" <marjan@discussions.microsoft.com> wrote in message
news:5E9FB8B4-8556-4514-9508-3B9181E0F2C0@microsoft.com...
> I'm trying to get an automatic date or time into a userform. Can someone
help
> me with this.
> --
> Thanks,
> Marjan
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" <marjan@discussions.microsoft.com> wrote in message
> news:5E9FB8B4-8556-4514-9508-3B9181E0F2C0@microsoft.com...
> > I'm trying to get an automatic date or time into a userform. Can someone
> help
> > me with this.
> > --
> > Thanks,
> > Marjan
>
>
>
Use a textbox instead:
Private Sub Userform_Activate()
Textbox1.Value = format(now,"mm/dd/yyyy hh:mm")
End sub
"marjan" <marjan@discussions.microsoft.com> wrote in message
news:88E42AA6-B2AF-44FB-8DA8-E7271504182E@microsoft.com...
> 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" <marjan@discussions.microsoft.com> wrote in message
> > news:5E9FB8B4-8556-4514-9508-3B9181E0F2C0@microsoft.com...
> > > I'm trying to get an automatic date or time into a userform. Can
someone
> > help
> > > me with this.
> > > --
> > > Thanks,
> > > Marjan
> >
> >
> >
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" <marjan@discussions.microsoft.com> wrote in message
> news:88E42AA6-B2AF-44FB-8DA8-E7271504182E@microsoft.com...
> > 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" <marjan@discussions.microsoft.com> wrote in message
> > > news:5E9FB8B4-8556-4514-9508-3B9181E0F2C0@microsoft.com...
> > > > I'm trying to get an automatic date or time into a userform. Can
> someone
> > > help
> > > > me with this.
> > > > --
> > > > Thanks,
> > > > Marjan
> > >
> > >
> > >
>
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks