Hi i have userform with combobox 9 when you select combobox9 value it will show all the values into the each boxes and you can updated the textbox 19 value into sheet against the raw of the selected value in combobox9 however problem is if theres the same name e.g. twice same name in combobox9 it will only update the its 1st name on the raw and not the 2nd or even if there is 3 entry in sheet with same name.
names are in coloum C and textvalue is updated its name on coloum H however i need to loop the coloum H if it is already updated against its name then same name needs to updated which is in new raw.
below its the vba code i have so far but it it is till not working
names are in coloum C and textvalue is updated its name on coloum H however i need to loop the coloum H if it is already updated against its name then same name needs to updated which is in new raw.
below its the vba code i have so far but it it is till not working
VBA Code:
If Me.ComboBox9.Value <> "" Then
If VBA.CVar(Application.Match(VBA.CVar(Me.ComboBox9.Value), sh.Range("C:C"), 0)) = True Then
MsgBox "Record Not found for this PO-Number", vbCritical
Exit Sub
Else
i = Application.Match(VBA.CStr(Me.ComboBox9.Value), sh.Range("C:C"), 0)
End If
lCol = Me.ComboBox9.Value
Set findvalue2 = sh.Range("C:C").Find(What:=lCol, LookIn:=xlValues)
If Not findvalue2 Is Nothing Then
adr = findvalue2.Address
Do
If findvalue2.Offset(0, -1).Value = Me.TextBox19 Then
sh.Unprotect "1234"
findvalue2.Offset(0, 6).Value = Me.TextBox19.Value = ""
Exit Do
End If
Set findvalue2 = sh.Range("C:C").FindNext(findvalue2)
Loop While findvalue2.Address <> adr
Set findvalue2 = Nothing
End If