Excel Macro - Insert Cellls Based On Cell Value

MathewH93

New Member
Joined
Jan 7, 2014
Messages
2
Hello

Using Excel 2007.. I need to find a way to insert cells based on a cell value, for example if cell D2 says "4" then I need a macro that can insert that amount of rows.

To make things more complicated, I will need to ensure that the macro inserts rows after the row with a specific text string.

For example I enter "@@@" in cell A50 and then I need the macro to insert the amount of rows displayed in cell D2 after that row.

The row at which I enter "@@@" will be different each time but the cell which displays the amount of rows to enter will be the same.

Is this possible?

I forgot to add that once the rows have been inserted, I will then need to copy a formula into those rows.

Many Thanks.

Matt
 
Last edited:

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Matt,

welcome to the forum.

Can you post a sample of your data and what it will look like after the code is run.

thx

FarmerScott
 
Upvote 0
Hi Scott,
Thanks for your reply.

Could you provide me an email address so I can attach the file, I wont be able to explain exactly what I need using this thread and it will be easier to understand when you see the file.

Cheers

Matt
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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