Adding rows based upon different numbers number

April 3, 2012 at 17:52:02
Specs: Windows 7
Hello,

I have a data sheet where the number in Column C is a number that fluctuates between 0 and 64. I need to be able to add (x-1) rows above it. So if the number is 4, I'd like to add 3 rows above it (and copying all the other data from the same row). If above is not possible, then below is OK too. As an additional condition (but less important one), it would be good if in the inserted rows could count from 0 to the number it was based off (so in the previous example, the 3 rows would have 1, 2, 3 and end with 4). If that last sentence was too confusing, then just ignore it and I can make an IF function to build that out.

I think a macro is possible to make this happen but I have no macro experience at all.

Any help on this problem?

Thank you so much for any help you may provide.


See More: Adding rows based upon different numbers number

Report •

#1
April 3, 2012 at 19:02:39
There are parts of the question that don't make sense.

In your example you said you want to add 3 rows because Coulmn C contained a 4. Then you said you want your numbering scheme to start at 0, yet you said the new rows should contain 1, 2, 3. Where does the zero go?

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
April 4, 2012 at 15:43:48
Hi. Sorry I misspoke. There should be no zero and it should start counting from 1.

Here's what my data set looks like:

C
4
3
5

And I would like it to expand to:
C
4
1
2
3
3
1
2
5
1
2
3
4

Though if the numbers could go above so that it's sequentially 1,2,3,4, it would be better though below is fine.


Thank you so much for your help!


Report •
Related Solutions


Ask Question