Find duplicate cell, insert row below, calculate VBA

BanaBrian

New Member
Joined
Jan 23, 2013
Messages
1
Greetings,
After searching the forum, I cannot locate anything similar to this scenario, so here it is:
1. Locate duplicate part numbers (Column C).
2. When identified, insert a blank row below
3. Copy cells above blank cell in Columns A, C, D, and E
4. Concatenate the two cells above blank cell in Columns B and F with " / " between
5. Sum the two cells above blank cell in Columns G, H, I, L-BI
6. Calculate blank cells in Columns J and K (Ex. I4+H4-G4)

The attachment has the before and after scenarios.
Thank you very much for your consideration and I look forward to hearing from the resident VBA experts.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
For the duplicate side of things if the data is in order, you can pick a column, and use:

=if(A1=A2,1,"")
Run that down (Autofill Down)

if it's not in order, then use:

=if(countif(A:A,A1)>1,1,0)


That will make it easy to identify where you need to act. Everything that has a 1 is a duplicate.

For the balance of the request, you could record the requirements in excel, and then replay it as required.

If you're not proficient in VBA code, then try this:

http://www.mrexcel.com/forum/excel-...visual-basic-applications-beginners-book.html
http://www.mrexcel.com/forum/genera...isual-basic-applications-books-beginners.html

Best of luck
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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