clarksonneo
01-08-2011, 07:21 AM
Hi,
I want a marco that can list all items in a range.
However, I don't want repeated items.
Please refer to the picture below.
Column H is the result that I want.
However, my code can produce the result like column G only.
The items are in range(C5:E7).
Could you please amend my code so that I can produce the result like column H?
Thanks
Sub ShowAllItems1()
ActiveCell.CurrentRegion.Select
Set a = Selection
i = 1
For Each x In a
x.Copy
Cells(4 + i, 7).PasteSpecial
i = i + 1
Next
End Sub
I want a marco that can list all items in a range.
However, I don't want repeated items.
Please refer to the picture below.
Column H is the result that I want.
However, my code can produce the result like column G only.
The items are in range(C5:E7).
Could you please amend my code so that I can produce the result like column H?
Thanks
Sub ShowAllItems1()
ActiveCell.CurrentRegion.Select
Set a = Selection
i = 1
For Each x In a
x.Copy
Cells(4 + i, 7).PasteSpecial
i = i + 1
Next
End Sub