Hello,
im trying to move the first row in list box into the header with this code is it possible ?
Thanks in advance
im trying to move the first row in list box into the header with this code is it possible ?
VBA Code:
Function show_data_in_listbox_test()
Dim lastrow As Long, Row As Long, Col As Long, TempArray
With Sheets("Database")
lastrow = .Cells(Rows.Count, "A:A").End(xlUp).Row
TempArray = .Range("A1:I" & lastrow).Value
For Row = 1 To lastrow
For Col = 3 To 6 '---select.name.for.the.columns; from 3 to 6 with Col= 3:6'
TempArray(Row, Col) = Format(TempArray(Row, Col), "h:mm:ss AM/PM")
Next Col
TempArray(Row, 7) = Format(TempArray(Row, 7), "h:mm:ss")
TempArray(Row, 8) = Format(TempArray(Row, 8), "h:mm:ss")
TempArray(Row, 9) = Format(TempArray(Row, 9), "h:mm:ss")
Next Row
End With
With ListBox1
.ColumnCount = 9
.ColumnWidths = "70,65,75,75,75,75,90,60,55,55"
.List = TempArray
End With
End Function
Thanks in advance