Hello Forum,
I'm trying to write a conditional macro where VBA will add (x) number of rows depending on how many separate numbers appear in a specific cell. However, I just discovered VBA and I can't find any postings that specifically address this scenario. I don't know if it can be done with a formula - I figured only VBA could add rows dynamically. I've included a generic and fictional example below of how the data appears and how it needs to look like. I am using Excel 2010.
Important Note: Ideally, all of the customer data that appears in columns A - L and N - onward should all replicate on the rows that are created beneath the first row. Also, all of the account number values will be delimited by a comma that separates them and some of them will vary slightly in length.
CURRENT FORM:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]....
[/TD]
[TD]....
[/TD]
[TD]Column M
[/TD]
[/TR]
[TR]
[TD]Customer_Name
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Account_Number
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]1111111111,2222222222,333333333,44444444444,5555555555,6666666666,7777777777
[/TD]
[/TR]
</tbody>[/TABLE]
DESIRED FORM:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]....
[/TD]
[TD]....
[/TD]
[TD]Column M
[/TD]
[/TR]
[TR]
[TD]Customer_Name
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Account_Number
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]1111111111
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]2222222222
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]333333333
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]44444444444
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]5555555555
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]6666666666
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]7777777777
[/TD]
[/TR]
</tbody>[/TABLE]
I have no idea if this can be done but I would be eternally grateful if so
Thank you in advance for your help!
~Eric
I'm trying to write a conditional macro where VBA will add (x) number of rows depending on how many separate numbers appear in a specific cell. However, I just discovered VBA and I can't find any postings that specifically address this scenario. I don't know if it can be done with a formula - I figured only VBA could add rows dynamically. I've included a generic and fictional example below of how the data appears and how it needs to look like. I am using Excel 2010.
Important Note: Ideally, all of the customer data that appears in columns A - L and N - onward should all replicate on the rows that are created beneath the first row. Also, all of the account number values will be delimited by a comma that separates them and some of them will vary slightly in length.
CURRENT FORM:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]....
[/TD]
[TD]....
[/TD]
[TD]Column M
[/TD]
[/TR]
[TR]
[TD]Customer_Name
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Account_Number
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]1111111111,2222222222,333333333,44444444444,5555555555,6666666666,7777777777
[/TD]
[/TR]
</tbody>[/TABLE]
DESIRED FORM:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]....
[/TD]
[TD]....
[/TD]
[TD]Column M
[/TD]
[/TR]
[TR]
[TD]Customer_Name
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Account_Number
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]1111111111
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]2222222222
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]333333333
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]44444444444
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]5555555555
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]6666666666
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]7777777777
[/TD]
[/TR]
</tbody>[/TABLE]
I have no idea if this can be done but I would be eternally grateful if so
Thank you in advance for your help!
~Eric