Hi all,
I am new to VBA and learning form you all!
i wanted to prepare voucher and wish that credit entry should be negative in textbox3 following what i did so far;
Dim lngWriteRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
lngWriteRow = ws.Cells(Rows.Count, 2) _
.End(xlUp).Offset(1, 0).Row
ws.Range("B" & lngWriteRow) = TextBox1.Value
ws.Range("C" & lngWriteRow) = TextBox2.Value
ws.Range("D" & lngWriteRow) = TextBox3.Value*-1
ws.Range("E" & lngWriteRow) = TextBox4.Value
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.TextBox3.Value = ""
Me.TextBox4.Value = ""
End Sub
At first click it adds data correctly but if i click again on empty user-form it gives error....don't know how to deal with it...
Bookmarks