problem update data from listbox on userform to worksheet

abdelfattah

New member
Joined
Jul 17, 2020
Messages
10
Reaction score
0
Points
0
Excel Version(s)
2010
hello
i need help to find where is the problem it only update in the listbox doesn't update in work sheet
this is my code
HTML:
 Private Sub cmdUpdate_Click() 
  For c = 0 To 4  
 On Error Resume Next  
 Me.ListBox1.Column(c) = Me("textbox" & c + 1)  
 Next c 
  Dim i As Long 
  For i = 1 To sheet1.Range("a100000").End(xlUp).Row 
  If sheet1.Cells(i, "c") = Val(Me.TextBox3) Then 
  For X = 1 To 4   
sheet1.Cells(i, X) = Me("textbox" & X)  
 Me("textbox" & X) = ""  
 Next X  
 End If 
  Next i
End Sub
 

Attachments

  • update & higlihgt1.xlsm
    23.6 KB · Views: 14
Last edited:
hi, Nos your suggestion has helped me so much about the val it works but i would like to explain me if you don't mind why this causes the problem , by the way i got this code from the internet this is not mine and works this is strange :clap2:
 
Last edited:
thanks Nos it's kind of you to provide this link to understand it
 
Back
Top