newtoVBA2018
New Member
- Joined
- Dec 14, 2018
- Messages
- 1
Hi All,
very new to VB. I want to be able to edit data from list box. I can get the data to transfer the list box into the text boxes. I then want to be able to edit the text box and move it back into excel. I have stumbling through the below code, but it does not seem to do anything. Any help would be appreciated.
Private Sub Edit_Data_Click()
Dim erowa As Integer, x As Integer, Sheets1 As Worksheet
Set ws = Sheets("Data")
erowa = Application.WorksheetFunction.CountA(ws.Range("A:A"))
For x = 2 To erowa
If ws.Cells(x, "A").Value = Me.TextBox24.Text Then
ws.Cells(x, "B").Value = Me.TextBox2.Text
ws.Cells(x, "C").Value = Me.TextBox3.Text
ws.Cells(x, "D").Value = Me.TextBox4.Text
ws.Cells(x, "E").Value = Me.TextBox5.Text
End If
Next
very new to VB. I want to be able to edit data from list box. I can get the data to transfer the list box into the text boxes. I then want to be able to edit the text box and move it back into excel. I have stumbling through the below code, but it does not seem to do anything. Any help would be appreciated.
Private Sub Edit_Data_Click()
Dim erowa As Integer, x As Integer, Sheets1 As Worksheet
Set ws = Sheets("Data")
erowa = Application.WorksheetFunction.CountA(ws.Range("A:A"))
For x = 2 To erowa
If ws.Cells(x, "A").Value = Me.TextBox24.Text Then
ws.Cells(x, "B").Value = Me.TextBox2.Text
ws.Cells(x, "C").Value = Me.TextBox3.Text
ws.Cells(x, "D").Value = Me.TextBox4.Text
ws.Cells(x, "E").Value = Me.TextBox5.Text
End If
Next