hi
I need from experts to help me to complete my project . currently when I search the customer it just show the debit , credit what I want when run userform show all of data and populate values after summing total of column DEBIT, column CREDIT and populate the values in textbox(DEBIT,CREDIT) and textbox (BALANCE) should subtract between textbox(DEBIT,CREDIT) with shows number format as in pic1 and when search specific customer should insert column BALANCE in listbox and calculate the values . in first row BALANCE = DEBIT-CREDIT the second BALANCE= provoius BALANCE + DEBIT-CREDIT with shows number formatting in list box as in PIC2
this is the whole code
I hope some body help
I need from experts to help me to complete my project . currently when I search the customer it just show the debit , credit what I want when run userform show all of data and populate values after summing total of column DEBIT, column CREDIT and populate the values in textbox(DEBIT,CREDIT) and textbox (BALANCE) should subtract between textbox(DEBIT,CREDIT) with shows number format as in pic1 and when search specific customer should insert column BALANCE in listbox and calculate the values . in first row BALANCE = DEBIT-CREDIT the second BALANCE= provoius BALANCE + DEBIT-CREDIT with shows number formatting in list box as in PIC2
this is the whole code
VBA Code:
Private Sub UserForm_Initialize()
Dim LastRow As Long
LastRow = Range("A" & Rows.Count).End(xlUp).Row
With ListBox1
.ColumnCount = 6
.ColumnWidths = "50;100;50;70;70;50;50"
.List = Range("A1:F" & LastRow).Value
End With
End Sub
Private Sub MY_List_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = vbKeyEscape Then
Me.MY_Text = ""
Me.MY_Text.SetFocus
ElseIf KeyCode = vbKeyF12 Then
Unload Me
End If
End Sub
Private Sub CommandButton4_Click()
Dim MyValue
Dim MyAr() As String
Dim ib As Boolean
Dim RR As Integer, I As Integer, ii As Integer
Dim RRr As Integer, LR As Integer
Dim dt1 As Date, dt2 As Date
Dim LastRow As Integer, R As Integer, T As Integer, s As Integer
MY_List.Clear
With ActiveSheet
LastRow = .Cells(.Rows.Count, "C").End(xlUp).Row
For R = 2 To LastRow
If .Cells(R, "C") Like "*" & MY_Text.Text & "*" Then
MY_List.AddItem
MY_List.List(T, 0) = .Cells(R, "A")
MY_List.List(T, 1) = Format(.Cells(R, "B"), "yyyy/mm/dd")
MY_List.List(T, 2) = .Cells(R, "C")
MY_List.List(T, 3) = .Cells(R, "D")
MY_List.List(T, 4) = .Cells(R, "E")
MY_List.List(T, 5) = .Cells(R, "F")
T = T + 1
End If
Next
End With
I hope some body help