Macro to add, delete and edit data to a table

skf786

Board Regular
Joined
Sep 26, 2010
Messages
155
Hi,

im looking for a macro that can help me add, delete and edit data available in a table.

Input cells are A1:C1 (Reference number, customer name and phone number) and table starts from A5:c5 (has headers) and goes down as more data is added to it.

Add Data: User inputs data in cell a1:c1 and presses a Button 1 that adds the data at the last row in the table and returns to blank cell A1:C1.

Delete Data: User inputs reference number in cell a2 and presses a Button 2 that searches the reference number in the table and deletes the full row i.e. a to c and returns to blank cell A2.

Edit Data: User inputs reference number in cell a3 and inputs revised data in b3 and c3 and presses a Button 3 that searches the reference number in the table and replaces the full row with the new data (from a3:c3) and returns to blank cell A3:c3.

Many thanks for your help.

Best wishes,

skf
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Alex Blakenburg

Well-known Member
Joined
Feb 23, 2021
Messages
2,686
Office Version
  1. 365
Platform
  1. Windows
If you have no experience with macros you might want to give this a try.
You can still have a button that invoked the Data Entry Form.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,394
Messages
5,769,828
Members
425,574
Latest member
grimeslisa

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
Top