Hi Anyone
Simple routine required for updating record in a textbox of selected item in combobox and the same to be seen in the worksheet
At present the uf textboxes shows the records as per the worksheet.
what i want is if i change or modify in textbox it should display the same in the respective row number of that current item of combobox in the worksheet by clicking update
Ive gone thru few threads but somehow it did not match
Code
Private Sub cmbClientNo_Click()
Dim ws As Worksheet
Set ws = Sheets("Clients")
Dim idx As Long
idx = cmbClientNo.ListIndex
If idx <> -1 Then
ufAddress.txtName.Value = Worksheets("Clients").Range("B" & idx + 2).Value
ufAddress.txtAdd1.Value = Worksheets("Clients").Range("C" & idx + 2).Value
ufAddress.txtAdd2.Value = Worksheets("Clients").Range("D" & idx + 2).Value
ufAddress.txtAdd3.Value = Worksheets("Clients").Range("E" & idx + 2).Value
ufAddress.txtAdd4.Value = Worksheets("Clients").Range("F" & idx + 2).Value
End If
End Sub
Private Sub cmdUpdate_Click()
End Sub
Private Sub UserForm_Initialize()
With cmbClientNo
.RowSource = "Clients!a2:F10"
End With
End Sub
Display More
Thanks in Advance
Sam D