Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default Highlight text in textbox

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Highlight text in textbox

Private Sub Userform_Activate()

With Me.TextBox1

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

--
__________________________________
HTH

Bob

"Erik" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default Highlight text in textbox

Thanks!
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
Highlight text in Textbox jnf40 Excel Programming 3 January 2nd 08 10:53 PM
Highlight the contain of textbox and radio button Peter Cheang Excel Programming 0 August 11th 06 04:50 PM
Highlight certail text in a userform Text box sheeba Excel Programming 0 February 4th 06 10:58 AM
highlight text in userform textbox RB Smissaert Excel Programming 1 November 2nd 05 11:44 PM
Highlight all Text in a Textbox when the textbox is selected RPIJG[_73_] Excel Programming 3 October 28th 05 08:28 PM


All times are GMT +1. The time now is 03:12 AM.

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"