LegenDSlayeR
New Member
- Joined
- Nov 26, 2020
- Messages
- 6
- Office Version
- 2016
- Platform
- Windows
Good Morning.
im hoping this is my problem, i need help with being able to edit a row. Userform1 has 2 listboxes. one show data from my worksheet "airstock" and the other listbox is a search. i have a search button which works fine searching for the data i need. however when i double click on the product i want to edit, it opens up a new userform to make the changes i need i only need to change the Quantity and Air location. . when i click on the update changes. it only changes in the listbox and not on the work sheet. can this be done ??
please see attached the userforms. and the codes
Userform 1 code for lstsearch
Userform2 code. for edit
thanks in advanced
im hoping this is my problem, i need help with being able to edit a row. Userform1 has 2 listboxes. one show data from my worksheet "airstock" and the other listbox is a search. i have a search button which works fine searching for the data i need. however when i double click on the product i want to edit, it opens up a new userform to make the changes i need i only need to change the Quantity and Air location. . when i click on the update changes. it only changes in the listbox and not on the work sheet. can this be done ??
please see attached the userforms. and the codes
Userform 1 code for lstsearch
VBA Code:
Private Sub lstsearch_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
UserForm2.TextBox2.Text = Me.lstsearch.Column(5)
UserForm2.TextBox4.Text = Me.lstsearch.Column(1)
UserForm2.TextBox3.Text = Me.lstsearch.Column(6)
UserForm2.TextBox5.Text = Me.lstsearch.Column(0)
UserForm2.TextBox6.Text = Me.lstsearch.Column(3)
UserForm2.Show
UserForm3.TextBox1.Text = Me.lstsearch.Column(0)
UserForm3.TextBox2.Text = Me.lstsearch.Column(1)
UserForm3.TextBox3.Text = Me.lstsearch.Column(7)
UserForm3.TextBox4.Text = Me.lstsearch.Column(4)
UserForm3.TextBox5.Text = Me.lstsearch.Column(3)
UserForm3.TextBox6.Text = Me.lstsearch.Column(5)
UserForm3.TextBox7.Text = Me.lstsearch.Column(6)
UserForm3.Show
End Sub
Userform2 code. for edit
Code:
Private Sub CommandButton1_Click()
UserForm1.lstsearch.Column(1) = Me.TextBox4.Text
UserForm1.lstsearch.Column(5) = Me.TextBox2.Text
UserForm1.lstsearch.Column(6) = Me.TextBox3.Text
UserForm1.lstsearch.Column(0) = Me.TextBox5.Text
UserForm1.lstsearch.Column(3) = Me.TextBox6.Text
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox6.Text = ""
TextBox5.Text = ""
End Sub
thanks in advanced