Insert rows with formulas and formatting based on cell variable

LEWI_74

New Member
Joined
Apr 24, 2008
Messages
46
Good morning,

I have a variable in cell A1 and a two row table from A3:C5 (when A1 = 0) with formulas (looking up from another sheet) and border formatting.

When the variable in A1 changes for example to 4, I would like 4 additional rows added to the table (with formulas and formatting), taking the table range to A3:C9

Likewise, when using the same file again, if the variable in cell A1 is now 2, I would like the table to be from A3:C7 (with formulas and formatting).

I am a VBA newbie and despite looking up across the internet for solutions, I haven’t been successful.

Could someone help please?

Thanks in anticipation.

David


 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,215,338
Messages
6,124,357
Members
449,155
Latest member
ravioli44

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