I have a Employee Tracker form which allow me to Add New record and save it. But I want a code on how to edit the existing record. Attached the macro sheet. Kindly help me to edit and save the record.
Editing existing record in user form
-
umakanth79in -
April 13, 2017 at 9:12 AM -
Thread is marked as Resolved.
-
-
-
Re: Editing existing record in user form
Hi umakanth79in,
enable the frame2 and useCode
Display MorePrivate Sub CommandButton2_Click() ' Worksheets("Data").Cells(i, 1).Value = txtEmpId.Text Worksheets("Data").Cells(i, 2).Value = txtEmpName.Text Worksheets("Data").Cells(i, 3).Value = txtContact.Text Worksheets("Data").Cells(i, 4).Value = txtExprience.Text Worksheets("Data").Cells(i, 5).Value = txtSkills.Text Worksheets("Data").Cells(i, 6).Value = txtLocation.Text Worksheets("Data").Cells(i, 7).Value = txtSharedon.Text Worksheets("Data").Cells(i, 8).Value = txtSharedwith.Text Worksheets("Data").Cells(i, 9).Value = txtStatus.Text Worksheets("Data").Cells(i, 10).Value = txtComments.Text End Sub
-
Re: Editing existing record in user form
Thanks a lot. It's working fine now.
I need one more help. Whenever I am inserting a new record it should save as 1st row of data sheet rather than saving at the last. -
Re: Editing existing record in user form
try,,,
Code
Display MoreWorksheets("Data").Rows("2:2").Insert Shift:=xlDown Worksheets("Data").Cells(2, 1).Value = txtEmpId.Text Worksheets("Data").Cells(2, 2).Value = txtEmpName.Text Worksheets("Data").Cells(2, 3).Value = txtContact.Text Worksheets("Data").Cells(2, 4).Value = txtExprience.Text Worksheets("Data").Cells(2, 5).Value = txtSkills.Text Worksheets("Data").Cells(2, 6).Value = txtLocation.Text Worksheets("Data").Cells(2, 7).Value = txtSharedon.Text Worksheets("Data").Cells(2, 8).Value = txtSharedwith.Text Worksheets("Data").Cells(2, 9).Value = txtStatus.Text Worksheets("Data").Cells(2, 10).Value = txtComments.Text
-
Re: Editing existing record in user form
Quote from pike;790575try,,,
Code
Display MoreWorksheets("Data").Rows("2:2").Insert Shift:=xlDown Worksheets("Data").Cells(2, 1).Value = txtEmpId.Text Worksheets("Data").Cells(2, 2).Value = txtEmpName.Text Worksheets("Data").Cells(2, 3).Value = txtContact.Text Worksheets("Data").Cells(2, 4).Value = txtExprience.Text Worksheets("Data").Cells(2, 5).Value = txtSkills.Text Worksheets("Data").Cells(2, 6).Value = txtLocation.Text Worksheets("Data").Cells(2, 7).Value = txtSharedon.Text Worksheets("Data").Cells(2, 8).Value = txtSharedwith.Text Worksheets("Data").Cells(2, 9).Value = txtStatus.Text Worksheets("Data").Cells(2, 10).Value = txtComments.Text
It's worked fine.
Now I am having one more request. How can I covert this VB Excel macro to Google sheet. Could you please help me on this
-
-
Re: Editing existing record in user form
Quote from pike;790575try,,,
Code
Display MoreWorksheets("Data").Rows("2:2").Insert Shift:=xlDown Worksheets("Data").Cells(2, 1).Value = txtEmpId.Text Worksheets("Data").Cells(2, 2).Value = txtEmpName.Text Worksheets("Data").Cells(2, 3).Value = txtContact.Text Worksheets("Data").Cells(2, 4).Value = txtExprience.Text Worksheets("Data").Cells(2, 5).Value = txtSkills.Text Worksheets("Data").Cells(2, 6).Value = txtLocation.Text Worksheets("Data").Cells(2, 7).Value = txtSharedon.Text Worksheets("Data").Cells(2, 8).Value = txtSharedwith.Text Worksheets("Data").Cells(2, 9).Value = txtStatus.Text Worksheets("Data").Cells(2, 10).Value = txtComments.Text
It's worked fine.
Now I am having one more request. How can I covert this VB Excel macro to Google sheet. Could you please help me on this.
Attached final code sheet for reference
-
Re: Editing existing record in user form
Hi umakanth79in,
The question is unrelated to the thread title.
Can you please start a new thread with relevant title.
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!