Greetings Everyone,
I have a Userform that displays the time in a decimal format. I cannot figure out how to make it correctly display the time in the listbox. Please help! Thanks in advance for any input.
Sincerely,
David
(See attached file)
Greetings Everyone,
I have a Userform that displays the time in a decimal format. I cannot figure out how to make it correctly display the time in the listbox. Please help! Thanks in advance for any input.
Sincerely,
David
(See attached file)
Your code is all over the place. Best thing I can do is to put a tempoary patch. In your UserForm_Initalize() procedure, add this lines to your code
So your full code will looks like![]()
'// Format Time ColumnColumn For i = 0 To Me.LB_00.ListCount - 1 Me.LB_00.List(i, 6) = Format(Val(Me.LB_00.List(i, 6)), "hh:mm:ss AM/PM") Next i
![]()
Private Sub UserForm_Initialize() Dim i As Long CT_00.Value = WorksheetFunction.Max([NRs]) + 1 ' Row count 'CT_08.List = Array("Male", "Female", "Trans", "Not Given", "Other") CT_08.List = [offloc_tbl].Value CT_10.List = [CaseDisp_tbl].Value CT_11.List = [AttSch_tbl].Value CT_12.List = [BehCode_tbl].Value CT_13.List = [ModGiven_tbl].Value CT_14.List = [EdLevel_tbl].Value CT_17.List = [YoP_tbl].Value 'CT_13.List = [ET_tbl].Value 'CT_15.List = [RO_tbl].Value 'CT_16.List = Split("Yes No") 'CT_20.List = Array("Cancer Patient", "Family member", "Carer", "Other Patient") 'CT_21.List = [CT_tbl].Value 'CT_23.List = Split("Yes No") 'CT_26.List = Split("2 3 4") 'CT_27.List = Array("Face to face (outreach)", "Face to face (home visits)", "Telephone", "Virtual") 'CT_28.List = [BF_tbl].Value 'CT_30.List = CT_28.List 'CT_32.List = CT_28.List 'CT_34.List = CT_28.List 'CT_36.List = CT_28.List 'CT_39.List = Array("Mand Recon", "Trib Att", "Trib Sup") With LB_00 .List = [data_tbl].Value .ColumnCount = [data_tbl].CurrentRegion.Columns.Count ListTotals = Sheets("Lists").Cells.Range("M8").Value FilteredTotal.Value = LB_00.ListCount & " Item(s) Currently Showing In The Listbox" '// Format Time ColumnColumn For i = 0 To Me.LB_00.ListCount - 1 Me.LB_00.List(i, 6) = Format(Val(Me.LB_00.List(i, 6)), "hh:mm:ss AM/PM") Next i End With End Sub
That is the fix! Many thanks. And yes the code is a mess, but a work in progress. I will pretty it up later. Thanks again for your help. It is greatly appreciated!
David
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks