Hi Guys..,
I have a problem , when i click update button its stopped here
[COLOR=#ff0000]ListBoxIn.List = Range(“datain”).Value [/COLOR]
here the complete code ( and please check the attached file) , please help me
Private Sub cmdupdate1_Click() Dim a As Byte If ListBoxIn.ListIndex = -1 Then MsgBox “Choose an item from the list!”, vbExclamation Exit Sub End If With ListBoxIn r = 0 On Error Resume Next r = .List(.ListIndex, 11) ‘<<<<< row number on sheet [Vendors]; On Error GoTo 0 If r = 0 Then r = .ListIndex + 3 End With zUpdating = True '<<<<< set flag (for ListBox4_Click routine) With Worksheets("Data") Application.EnableEvents = False .Cells(r, 1) = Me.ComboBox4.Value .Cells(r, 2) = Me.ComboBox5.Value .Cells(r, 3) = Me.TextBox3.Value .Cells(r, 4) = Me.DTPicker3.Value .Cells(r, 5) = Me.ComboBox6.Value .Cells(r, 6) = Me.TextBox4.Value .Cells(r, 7) = Me.TextBox7.Value .Cells(r, 8) = Me.TextBox6.Value .Cells(r, 9) = Me.TextBox5.Value .Cells(r, 10) = Me.ComboBox7.Value .Cells(r, 11) = Me.TextBox8.Value Application.EnableEvents = True End With TextBox1.Value = "": ComboBox2.Value = "" ListBoxIn.List = Range("datain").Value 'for refreshing vendors listbox ListBoxIn.ListIndex = -1 For a = 1 To 11 Controls("textbox" & a) = "" Next zUpdating = False MsgBox "Item has been updated" End Sub
download link https://goo.gl/g75hLi