Hello Everyone,
Can someone kindly help meas I’m new to VBA. I have a userformthat contains a listbox with several lines of data. When the user double clicks on a row in thelistbox, it populates a series of textboxes below. Right now, I can’t seem to get the ADD bottomto work. What I’d like to do is when theuser clicks on the ADD button the data that was double clicked into thetextboxes will copy to the last row of the worksheet. And after the data is pasted to theworksheet, I want it to clear from the textboxes. If anyone can help out, I’d really appreciateit. The code and link to the worksheet I’mworking with is below. Thank you inadvance.
https://www.dropbox.com/s/yenbsr2yn5z1aan/Customer Tracker.xlsm?dl=0
Can someone kindly help meas I’m new to VBA. I have a userformthat contains a listbox with several lines of data. When the user double clicks on a row in thelistbox, it populates a series of textboxes below. Right now, I can’t seem to get the ADD bottomto work. What I’d like to do is when theuser clicks on the ADD button the data that was double clicked into thetextboxes will copy to the last row of the worksheet. And after the data is pasted to theworksheet, I want it to clear from the textboxes. If anyone can help out, I’d really appreciateit. The code and link to the worksheet I’mworking with is below. Thank you inadvance.
https://www.dropbox.com/s/yenbsr2yn5z1aan/Customer Tracker.xlsm?dl=0
Rich (BB code):
Private Sub cmdAddData_Click()
Rich (BB code):
Rich (BB code):
Rich (BB code):
If TextBox1.Value ="" Or TextBox2 = "" Or TextBox3 = "" Then
If MsgBox("Data isIncomplete. Do you Want to Continue?", vbQuestion + vbYesNo) <>vbYes Then
Exit Sub
End If
End If
ActiveCell = TextBox1.Value
ActiveCell.Offset(0, 1) =TextBox2.Value
ActiveCell.Offset(0, 2) =TextBox3.Value
ActiveCell = TextBox6.Value
ActiveCell.Offset(0, 6) =TextBox7.Value
ActiveCell.Offset(0, 7) =TextBox8.Value
ActiveCell.Offset(1,5).Select
Call resetform
End Sub
Last edited: