Copy & Paste specific cells

AgustinGuerrero

New Member
Joined
May 8, 2022
Messages
3
Office Version
  1. 2016
Hello,

I have the following report that needs to be update each time there is a new client. So, based on the last client added I want to run a Macro that adds a new line (in this case will be after client "4" ) and then copy the values in the line above for columns D and Eand paste on the new line added.
So before running the Macro the picture will be like this:


1664919493695.png


And after the macro is run this is how it should be, so I can add manually the number, name and surname of the new client.

1664919643682.png


So I'm very new and only have the beginning that I guess is like this:

Range("a:a").Find("4").Select
Selection.Offset(1, 0).Select
Selection.EntireRow.Insert

Many thanks in advance!! :)
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Not sure I understand.

So if you enter any value in Column A row 3 for example you want same values in columns D and E of row 2 entered into row 3 column D and E is that what you want?
 
Upvote 0
Not sure I understand.

So if you enter any value in Column A row 3 for example you want same values in columns D and E of row 2 entered into row 3 column D and E is that what you want?
Hi,
The report looks like the first screenshot, so when adding a new client, in this case would be nº 5, I want to add a row just below the last client (nº 4) and copy the data from the row above related to columns D and E. and repeat this until there is no more data on the file.
So basically i'd tell/populate into the macro which is the last (in the example nº4) so then the macro will search for this last client, add a row below and copying the data from columns D and E, so after running the macro the file should look as the 2nd screenshot.

many thanks for your help!
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,954
Members
448,535
Latest member
alrossman

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