Insert 2 rows, copy the formula.VBA HELP Pls [Solved/Closed]

Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,
I have a huge file to work on. Please help me with a VBA that does the following for the entire sheet (until the last row)

1) Whenever you see "Orange" in the "Fruit" column, Insert 2 rows after "Orange"
2) Copy the formula from the "Orange" row to the inserted rows in 1
3) First inserted row: Change the title in the "Fruit" column to Orange1 instead of Orange and Type O to O1
3) Second inserted row: Change the title in the "Fruit" column to Orange2 instead of Orange and Type O to O2

Sample data:
Fruit Type Total
Orange O 1
Apple A 2
Apple A 1
Orange O 10
Cherry C 2

After I run the macro I should get

Fruit Type Total
Orange O 1
Orange1 O1 1
Orange2 O2 1
Apple A 2
Apple A 1
Orange O 10
Orange1 O1 1
Orange2 O2 1
Cherry C 2

THANK YOU SO MUCH


2 replies

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
760
Could you please upload a sample EXCEL file WITH sample data, macro, formula , conditional formatting etc on some shared site like https://authentification.site , http://docs.google.com, http://wikisend.com/ , http://www.editgrid.com etc and post back here the link to allow better understanding of how it is now and how you foresee. Based on the sample book, could you re-explain your problem too
2
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2909 users have said thank you to us this month

Thanks rizvisa1. I figured it out :). Have a wonderful day
Jenny
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
760
Thanks for updating, Even nicer would have been had you posted solution so that some one else may benefit.