hi
can any body convert show all columns insted of on column ,please? my data start from COL A: E so based on condition it just show one column A . i would show all of the columns in listbox when run the userform .
can any body convert show all columns insted of on column ,please? my data start from COL A: E so based on condition it just show one column A . i would show all of the columns in listbox when run the userform .
VBA Code:
Private Sub UserForm_Initialize()
Dim a, b, i As Long, x, y
With Sheets("sheet1")
a = .Range("E1", .Range("E65536").End(xlUp)).Value
b = .Range("A1", .Range("b65536").End(xlUp)).Value
End With
With Me.ListBox1
For i = LBound(a) To UBound(a)
If IsDate(a(i, 1)) Then
x = DateSerial(Year(Date), Month(a(i, 1)), Day(a(i, 1)))
'y = DateDiff("d", x, Date)
If x >= Date Then
.AddItem b(i, 1)
End If
End If
Next
End With
End Sub