Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'm struggling abit here. I have the following formatting code for a couple
of textboxes. But it's not working. Any suggestions? Private Sub UserForm_Initialize() TextBox78 = Format(Sheets("summary").Range("N21"), "hh:mm") TextBox79 = Format(Sheets("summary").Range("N22"), "hh:mm") End Sub |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
That works fine but you have to have the time displayed in N21 and not just formatted to show the date. You can change the format of N21 & N22 at runtime if necessary to make it display the time Sheets("summary").Range("N21") = _ Format(Sheets("summary").Range("N21"), "hh:mm") then your line TextBox78.Text = Format(Sheets("summary").Range("N21"), "hh:mm") Mike "hoyos" wrote: I'm struggling abit here. I have the following formatting code for a couple of textboxes. But it's not working. Any suggestions? Private Sub UserForm_Initialize() TextBox78 = Format(Sheets("summary").Range("N21"), "hh:mm") TextBox79 = Format(Sheets("summary").Range("N22"), "hh:mm") End Sub |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Mike,
Thanks for replying. Do I put the first part of the formula in the sheet code and the other in the textbox code? Also the values in "hh:mm" are cumulative totals. It seems to go up to 24 hours and not beyond. "Mike H" wrote: Hi, That works fine but you have to have the time displayed in N21 and not just formatted to show the date. You can change the format of N21 & N22 at runtime if necessary to make it display the time Sheets("summary").Range("N21") = _ Format(Sheets("summary").Range("N21"), "hh:mm") then your line TextBox78.Text = Format(Sheets("summary").Range("N21"), "hh:mm") Mike "hoyos" wrote: I'm struggling abit here. I have the following formatting code for a couple of textboxes. But it's not working. Any suggestions? Private Sub UserForm_Initialize() TextBox78 = Format(Sheets("summary").Range("N21"), "hh:mm") TextBox79 = Format(Sheets("summary").Range("N22"), "hh:mm") End Sub |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this
TextBox78.Value = Format(Sheets("summary").Range("N21"), "hh:mm") TextBox79.Value = Format(Sheets("summary").Range("N22"), "hh:mm") "hoyos" wrote: I'm struggling abit here. I have the following formatting code for a couple of textboxes. But it's not working. Any suggestions? Private Sub UserForm_Initialize() TextBox78 = Format(Sheets("summary").Range("N21"), "hh:mm") TextBox79 = Format(Sheets("summary").Range("N22"), "hh:mm") End Sub |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Mike,
I have managed to sort it out by: Code in sheet "summary": Range("n21").Value = Range("m21").Value Range("n22").Value = Range("m22").Value Code in userform: TextBox79.Text = Sheets("summary").Range("N21").Text TextBox78.Text = Sheets("summary").Range("N22").Text Many thanks for your interest. "Mike" wrote: Try this TextBox78.Value = Format(Sheets("summary").Range("N21"), "hh:mm") TextBox79.Value = Format(Sheets("summary").Range("N22"), "hh:mm") "hoyos" wrote: I'm struggling abit here. I have the following formatting code for a couple of textboxes. But it's not working. Any suggestions? Private Sub UserForm_Initialize() TextBox78 = Format(Sheets("summary").Range("N21"), "hh:mm") TextBox79 = Format(Sheets("summary").Range("N22"), "hh:mm") End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Format Time as Text | Excel Worksheet Functions | |||
How do I average time (in text format) | Excel Discussion (Misc queries) | |||
change text format to time | Excel Worksheet Functions | |||
How do I convert a time to text format. | Excel Discussion (Misc queries) | |||
convert time imported as text to time format for calculations | Excel Worksheet Functions |