Can a macro automatically copy and paste a range x-1 times when x is entered in a box?

NEALR

New Member
Joined
Apr 14, 2011
Messages
1
Hello there - I am reasonably proficient in basic Excel, but before this week have never tried anything with macros. I'm struggling with some of the terminology and feel like I am below the bottom step of the macro proficiency ladder and unable to see onto it!

I am trying to do a monitoring sheet for work, where there may be nil to several dozen items to be listed after a particular action has been taken. The first 8 fields list parts of the action, the ninth is the count of how many follow ups are needed.

i.e. A-H are identifying fields, I is a number usually between 0 and say 24. Columns after that will be the details of the follow up actions. I will probably be auto-transferring those sections onto another sheet, but have found code to do that easily enough on these forums.

The problem I am having is in getting the columns A-H to be automatically copied (so A2-H2 would be copied onto all the lines A3-H3, A4-H4, A5-H5 and A6-H6 if the count in I was 5). Ideally this would happen automatically once the number in I was typed and the box tabbed or entered out of by the inputter.

I have managed to do a macro which repeatedly copies and pastes one line, but it has to be run every time, but it only works for the first line, not any different sets of A-H further down the sheet.

Firstly - Am I on the wrong track trying to use a macro to do this?

Secondly - Is there any way to get the automatic running of a macro in this way?

Thirdly - How is a macro written to ignore a zero or 1 value, but to do x-1 copies when a value greater than 1 is put in column I?

I did try a column J to give TRUE/FALSE if I is less than/equal to or greater than 2 in case that made it easier but am still stumped.

Assistance greatly appreciated, I've been giving myself a headache trying to figure this out this week!

Thanks to all.

NEALR
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,224,504
Messages
6,179,144
Members
452,891
Latest member
JUSTOUTOFMYREACH

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