Add column after each different name.

Kingkoopa

Board Regular
Joined
Aug 7, 2014
Messages
94
Hi Guys,

Using Windows 7 & Excel 2010.

I have the following list :

[TABLE="width: 192"]
<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl63, width: 64"]List[/TD]
[TD="class: xl63, width: 64"]Currency[/TD]
[TD="class: xl63, width: 64"]Status[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD]AUD[/TD]
[TD]V[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD]AUD[/TD]
[TD]V[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD]AUD[/TD]
[TD]V[/TD]
[/TR]
[TR]
[TD]Pear[/TD]
[TD]AUD[/TD]
[TD]V[/TD]
[/TR]
[TR]
[TD]Pear[/TD]
[TD]AUD[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]Durian[/TD]
[TD]AUD[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]Durian[/TD]
[TD]AUD[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]Mango[/TD]
[TD]AUD[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]Mango[/TD]
[TD]AUD[/TD]
[TD]D[/TD]
[/TR]
</tbody>[/TABLE]

Would like to add a column after every different name list.

So it ends up being following :

[TABLE="width: 192"]
<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl65, width: 64"]List[/TD]
[TD="class: xl65, width: 64"]Currency[/TD]
[TD="class: xl65, width: 64"]Status[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD]AUD[/TD]
[TD]V[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD]AUD[/TD]
[TD]V[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD]AUD[/TD]
[TD]V[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pear[/TD]
[TD]AUD[/TD]
[TD]V[/TD]
[/TR]
[TR]
[TD]Pear[/TD]
[TD]AUD[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Durian[/TD]
[TD]AUD[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]Durian[/TD]
[TD]AUD[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mango[/TD]
[TD]AUD[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]Mango[/TD]
[TD]AUD[/TD]
[TD]D[/TD]
[/TR]
</tbody>[/TABLE]

Any idea how I could do it :(.

Thank you
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Looks like you want to add a blank Row
You said:
Would like to add a column after every different name list.
 
Upvote 0
Assuming list is in column A
And you want to insert a empty row.
Try this:
Code:
Sub Test()
'Modified 4/16/2018 2:50 AM  EDT
Application.ScreenUpdating = False
Dim i As Long
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For i = Lastrow To 2 Step -1
    If Cells(i, 1).Value <> Cells(i, 1).Offset(-1).Value Then Rows(i).Insert xlShiftDown
Next
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Non code approach. Select a cell, add subtotals (ALT-D-B), select level 2 row grouping, ALT-; to get visible cells, and then DEL to erase unwanted items. Now level 3 grouping.
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

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