Welcome of Spring
New Member
- Joined
- Oct 31, 2022
- Messages
- 1
- Office Version
- 365
- 2021
- Platform
- Windows
Hi MrExcel friends,
I need some help on two things. I would like to know how do I write a Macro for something that looks like the below.
The first thing I want to do is to to insert 2 rows below whenever I see a Mango (we will only ever see one Mango within each Country) and paste into that 2 whole rows (ROWA&B).
ROWA&B is the same thing each time, and the cells inside has been formulated appropriately. I think I will only need to instruct the macro to copy it once. It's just the 56th and 57th row of my sheet (not pictured). I would like it to paste the formatting as well.
The second thing I want to do is I would like to, within each Country, drag the row where the Fruit = Apple to a row below the Fruit = Strawberry row. (I am not sure if I need the Macro to recognise the country as a unique category - we could just ask the macro to search for the next available row which says strawberry. Since the next available row that says strawberry is definitely within the same country.?)
Appreciate if you could let me know what is the VBA code for this.
I need some help on two things. I would like to know how do I write a Macro for something that looks like the below.
The first thing I want to do is to to insert 2 rows below whenever I see a Mango (we will only ever see one Mango within each Country) and paste into that 2 whole rows (ROWA&B).
ROWA&B is the same thing each time, and the cells inside has been formulated appropriately. I think I will only need to instruct the macro to copy it once. It's just the 56th and 57th row of my sheet (not pictured). I would like it to paste the formatting as well.
The second thing I want to do is I would like to, within each Country, drag the row where the Fruit = Apple to a row below the Fruit = Strawberry row. (I am not sure if I need the Macro to recognise the country as a unique category - we could just ask the macro to search for the next available row which says strawberry. Since the next available row that says strawberry is definitely within the same country.?)
Appreciate if you could let me know what is the VBA code for this.