• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Editing values in userform and update in worksheet

Hi,

It's me once more asking for your help...

In my userform (userform7), I added an Edit button (CommandButton1). Once clicked, I wanted this button to update the worksheet (logs) when I change or modify any or all previous entries of the textboxes and comboboxes in userform7. The default value (combobox12) should still serve as the reference of the items in the row that I want to edit.

I attached my file for your reference.

Thank you and I hope this is not too much.
 

Attachments

  • Form_Templates2.xlsm
    163.5 KB · Views: 11
You are in the right path, locating the row based on the value of Combobox12 and then using the same row number we can update the data..

Code:
  Set ws = Worksheets("Logs")
    Set myrange = Worksheets("Logs").Range("A:T")
  
    currentRow = ws.Columns("B:B").Find(what:=ComboBox12.Value, LookIn:=xlValues).Row
  
    'ISO Standard Conducted
    ws.Range("C" & currentRow).Value = ComboBox1.Value
  
    'Classification
    ws.Range("E" & currentRow).Value = ComboBox3.Value
  
    'Audit Type
    ws.Range("F" & currentRow).Value = ComboBox6.Value
  
    'ISO Clause
    ws.Range("G" & currentRow).Value = TextBox5.Text
  
    'Document affected
    ws.Range("H" & currentRow).Value = TextBox18.Text
  
  
    MsgBox "Record updated sucessfully", vbInformation

Hope this helps
 
Back
Top