Vertical to Horizontal & Eliminate Duplication

N

NirOrtal

Hi

I’m working with Excel 2007

I have a list of names in A1:A10. Some of the names are exist more than once.
I want to copy he list to C1:L1 and eliminate duplication in one action

Thanx
 
P

PBezucha

I hope it will work even in 2007. If you are free as to the space to the
right from your new header use the macro:

Sub SetHeaderFromTheList()
Dim DummyRange As Range
Range("A1").EntireRow.Insert
Set DummyRange = Range("B1:B10")
' (auxiliary column range located wherever, will be cleared)
Range("A1") = "Dummy header"
Range("A1:A11").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=DummyRange, Unique:=True
Range("A1").EntireRow.Delete
DummyRange.Copy
Range("C1").PasteSpecial Transpose:=True
DummyRange.Clear
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top