Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Force TextBox to hold time ("hh:mm")

Still Need Help!

Can anyone help?

I'm having a great deal of difficulty trying to have my TextBox display
time ("hh:mm") on a UserForm that I created. The TextBox will take the
time correctly, but when the UserForm re-opens it displays the time as
numbers not in the time format. It will only display the time once I
click in and them out of the TextBox. This will be too confusing for
my users!

My VBA code is attached to both the TextBox and the UserForm, on the
TimeTextBox1 I am using the following code:

Private Sub TimeTextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TimeTextBox1.Value = Format(TimeTextBox1.Value, "hh:mm")
End Sub

I am using a separate macro that runs the UserForm which actatives the
UserForm that has the following code:

Private Sub UserForm_Activate()
UserForm1.TimeTextBox1.Value =
Format(FrmNotifUpdate.TimeTextBox1.Value, "hh:mm")
End Sub

Thanks for your help!
RES

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Force TextBox to hold time ("hh:mm")

If you have your textbox linked to a cell (control source), then remove the
link.

--
Regards,
Tom Ogilvy


"Titus" wrote in message
ups.com...
Still Need Help!

Can anyone help?

I'm having a great deal of difficulty trying to have my TextBox display
time ("hh:mm") on a UserForm that I created. The TextBox will take the
time correctly, but when the UserForm re-opens it displays the time as
numbers not in the time format. It will only display the time once I
click in and them out of the TextBox. This will be too confusing for
my users!

My VBA code is attached to both the TextBox and the UserForm, on the
TimeTextBox1 I am using the following code:

Private Sub TimeTextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TimeTextBox1.Value = Format(TimeTextBox1.Value, "hh:mm")
End Sub

I am using a separate macro that runs the UserForm which actatives the
UserForm that has the following code:

Private Sub UserForm_Activate()
UserForm1.TimeTextBox1.Value =
Format(FrmNotifUpdate.TimeTextBox1.Value, "hh:mm")
End Sub

Thanks for your help!
RES



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
Hold a cell range for an "average formula" Wendy Akers Excel Worksheet Functions 2 May 29th 10 12:14 AM
Disabling the "&[Time]" or "&[T]" in Excel headers and footers John Mirabella Excel Discussion (Misc queries) 2 January 15th 10 02:54 PM
=EMBED("Forms.TextBox.1","") Lynda Excel Discussion (Misc queries) 1 September 28th 09 03:23 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
cannot use "Create List" and "Share Workbook" same time Devendra Excel Discussion (Misc queries) 0 October 26th 06 06:05 AM


All times are GMT +1. The time now is 03:41 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"