Banner

Wednesday, April 19, 2017

Display Post Dated Cheque Transaction In Userform Excell VBA



Private Sub UserForm_Initialize()
Dim i As Long
Me.Label1.Caption = Format(Date, "DD/MMM/YYYY")
Me.ListBox1.AddItem Sheet1.Cells(1, 1).Value
Me.ListBox1.Selected(0) = True
For a = 1 To 5
Me.ListBox1.List(ListBox1.ListCount - 1, a) = Sheet1.Cells(1, a + 1).Value
Next a
For i = 2 To Application.WorksheetFunction.CountA(Sheet1.Range("A:A"))
If Sheet1.Cells(i, "C").Value >= Date And Sheet1.Cells(i, "D").Value = "Bank" Then
Me.ListBox1.AddItem Sheet1.Cells(i, 1).Value
For b = 1 To 5
Me.ListBox1.List(ListBox1.ListCount - 1, b) = Sheet1.Cells(i, b + 1).Value
Next b
End If

Next i

End Sub

No comments:

Post a Comment

Please do not enter any spam message in comment box