Save button for resave edited entry

harimao

New Member
Joined
Oct 23, 2020
Messages
4
Office Version
  1. 2016
  2. 2013
  3. 2010
  4. 2007
Platform
  1. Windows
  2. MacOS
Hai expert there
my save button can only saving new entry, so how can coding as updating edited entry too?


Thanks
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi,
share the coding you have to save new entry - plenty here to offer suggestions how it could be modified to do what you want

Dave
 
Upvote 0
You'll need a separate button for an EDIT SAVE.

Try this macro :

VBA Code:
Sub SveEdit
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets(“Your Worksheet”)

    ‘find first empty row in database
    iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row

    ‘copy the data to the worksheet
    ws.Cells(iRow, 1).Value = Me.TextBox1.Value
    ws.Cells(iRow, 2).Value = Me.TextBox5.Value
    ws.Cells(iRow, 3).Value = Me.TextBox7.Value
    ws.Cells(iRow, 4).Value = Me.TextBox8.Value
    ws.Cells(iRow, 5).Value = Me.TextBox9.Value
End Sub

NOTE : the above is a suggestion ... you will need to edit some portions to match your project.
 
Upvote 0

Forum statistics

Threads
1,215,035
Messages
6,122,785
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top