When I start my excel workbook I want a userform to pop up with the current
time highlighted in a textbox. I must be able to overwrite that text and copy
that value to a cell in a worksheet. How can I do this?

The point is to record the time a show up for work and put dates and time in
a worksheet.

Private Sub Workbook_Open()
UserForm1.Show
End Sub

Private Sub UserForm_Initialize()
TextBox1.Text = WorksheetFunction.Text(Now(), "hh:mm")
TextBox1.EnterFieldBehavior = fmEnterFieldBehaviorSelectAll
End Sub

Re: Highlight text in textbox by Bob

Bob
Thu Jul 24 04:07:40 CDT 2008

Private Sub Userform_Activate()

With Me.TextBox1

.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End With
End Sub

--
__________________________________
HTH

Bob

"Erik" <Erik@discussions.microsoft.com> wrote in message
news:27881A95-5E38-4779-B302-B61029D01DCC@microsoft.com...
> When I start my excel workbook I want a userform to pop up with the
> current
> time highlighted in a textbox. I must be able to overwrite that text and
> copy
> that value to a cell in a worksheet. How can I do this?
>
> The point is to record the time a show up for work and put dates and time
> in
> a worksheet.
>
> Private Sub Workbook_Open()
> UserForm1.Show
> End Sub
>
> Private Sub UserForm_Initialize()
> TextBox1.Text = WorksheetFunction.Text(Now(), "hh:mm")
> TextBox1.EnterFieldBehavior = fmEnterFieldBehaviorSelectAll
> End Sub
>



Re: Highlight text in textbox by Erik

Erik
Fri Oct 17 08:26:10 CDT 2008

Thanks!