userform.jpg
So, I've created a userform to add products to our product spreadsheet. I am using the following code to update the spreadsheet but I am getting a compile error: For without Next
Private Sub CMDupdate_Click()
Dim SLNO As String
SLNO = Trim(TXTSLNO.Text)
lastrow = Worksheets("apparel").Cells(Row.Count, 1).End(xlUp).Row
For i = 2 To lastrow
If Worksheets("apparel").Cells(i, 1).Value = SLNO Then
Worksheets("apparel").cels(i, 1).Value = Txtproduct.Text
Worksheets("apparel").Cells(i, 3).Value = TxtDesign.Text
Worksheets("apparel").Cells(i, 5).Value = TxtFeatures.Text
Worksheets("apparel").Cells(i, 7).Value = cmbkeyupdate.Text
Worksheets("apparel").Cells(i, 8).Value = TxtUpdate.Text
Worksheets("apparel").Cells(i, 10).Value = TxtContinued.Text
Worksheets("apparel").Cells(i, 12).Value = CMBGender.Text
Worksheets("apparel").Cells(i, 13).Value = TXTMenHTML.Text
Worksheets("apparel").Cells(i, 14).Value = TxtWomenHTML.Text
Worksheets("apparel").Cells(i, 15).Value = CMBType.Text
Worksheets("apparel").Cells(i, 16).Value = CMBSeason.Text
Worksheets("apparel").Cells(i, 17).Value = TxtYear.Text
End If
End Sub
Any thoughts?
Bookmarks