Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hold a cell range for an "average formula" | Excel Worksheet Functions | |||
Disabling the "&[Time]" or "&[T]" in Excel headers and footers | Excel Discussion (Misc queries) | |||
=EMBED("Forms.TextBox.1","") | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
cannot use "Create List" and "Share Workbook" same time | Excel Discussion (Misc queries) |