Insert 2 rows, copy the formula.VBA HELP Pls

Solved/Closed
Jenny - Jul 28, 2010 at 06:17 PM
rizvisa1
Posts
4479
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
- Aug 5, 2010 at 07:33 AM
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

rizvisa1
Posts
4479
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
768
Jul 30, 2010 at 08:01 AM
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
Thanks rizvisa1. I figured it out :). Have a wonderful day
Jenny
0
rizvisa1
Posts
4479
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
768
Aug 5, 2010 at 07:33 AM
Thanks for updating, Even nicer would have been had you posted solution so that some one else may benefit.
0