ajiscullens
New Member
Hello VBA expert
can some one teach me how to add code for my text box into vlookup from cbocode drop down list ?
1) problem to add transaction . it keeps add at the same row
2) can't find way to add vlookup from my data sheet into form
3) i try to create transaction number continuously
this is my code
>>> use code - tags <<<
can some one teach me how to add code for my text box into vlookup from cbocode drop down list ?
1) problem to add transaction . it keeps add at the same row
2) can't find way to add vlookup from my data sheet into form
3) i try to create transaction number continuously
this is my code
>>> use code - tags <<<
Code:
Private Sub cmdAdd_Click()
'Copy input values to sheet.
Dim lRow As Long
Dim ws As Worksheet
Set ws = Worksheets("IN")
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(5, 0).Row
With ws
.Cells(lRow, 3).Value = Me.txtNumber.Value
.Cells(lRow, 4).Value = Me.cboCode.Value
.Cells(lRow, 5).Value = Me.txtItem.Value
.Cells(lRow, 6).Value = Me.txtDate.Value
.Cells(lRow, 7).Value = Me.txtSupplier.Value
.Cells(lRow, 8).Value = Me.txtQuantity.Value
End With
'Clear input controls.
Me.txtNumber.Value = ""
Me.cboCode.Value = ""
Me.txtItem.Value = ""
Me.txtDate.Value = ""
Me.txtSupplier.Value = ""
Me.txtQuantity.Value = ""
End Sub
Private Sub cmdClear_Click()
'Clear input controls.
Me.txtNumber.Value = ""
Me.cboCode.Value = ""
Me.txtItem.Value = ""
Me.txtDate.Value = ""
Me.txtSupplier.Value = ""
Me.txtQuantity.Value = ""
End Sub
Private Sub cmdClose_Click()
'Close UserForm1.
Unload Me
End Sub
Attachments
Last edited by a moderator: