0

I have a list of times (displaying 1:00 PM) in a column on the sheet, and I'm trying to load it into the userform:

Dim Converter() As String
ReDim Converter(LastRow)
For i = 0 To (LastRow)
    Converter(i) = Cells(i, 1).Text
Next i
JobStartSelect.List = Converter()

When I zoom out to the point where excel converts some of the longer times to #####, I notice my combobox list will also show #####, even if the list box itself has more than enough space. Is there any way to fix this?

Preferably I can load it into the combobox as a time value completely, which might fix this issue, since I plan to do calculations with it. As it stands, I'm using the text to fill the combobox, then separately loading the value to do calculations with.

Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
ffvxidxy
  • 3
  • 2
  • If you are wondering why you are getting `####` back then you might want to read this: http://stackoverflow.com/a/17363466/1153513 – Ralph May 30 '16 at 19:32
  • The solution depends on what you have actually stored in column A. Are the dates / times there actual dates / times or are they text which might seem to you like valid dates / times but are not recognized as such by Excel? To better understand my question you might want to read the following: http://stackoverflow.com/questions/37100821/change-date-format-using-substitute-or-replace/37101358#37101358 – Ralph May 30 '16 at 19:38

1 Answers1

0

Try

Converter(i) = Cells(i, 1).Value2

or

Converter(i) = format(Cells(i, 1),"hh:mm:ss AM/PM")
user3598756
  • 28,893
  • 4
  • 18
  • 28
  • It seems to be doing the same thing as .Value? - it's showing all my stuff as decimals. I want to show the AM/PM list. – ffvxidxy May 30 '16 at 18:56