Thread: More formatting
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.newusers
Bob Phillips
 
Posts: n/a
Default More formatting

How about this

Sub Test()

Dim iLastRow As Long
Dim i As Long
Dim iStart As Long
Dim rng As Range

iLastRow = Cells(Rows.Count, "B").End(xlUp).Row
iStart = iLastRow
For i = iLastRow To 1 Step -1
If Cells(i, "A").Value < "" Then
Rows(i + 1).Insert
Cells(i + 1, "A").Value = Cells(i, "B").Value
iStart = i - 1
Cells(i, "A").Font.Underline = True
Else
Cells(i, "A").Value = Cells(i, "B").Value
If Application.CountIf(Range("A" & i & ":A" & iStart), Cells(i,
"A").Value) 1 Then
If rng Is Nothing Then
Set rng = Rows(i)
Else
Set rng = Union(rng, Rows(i))
End If
End If
End If
Cells(i, "B").Value = ""
Next i
If Not rng Is Nothing Then rng.Delete
End Sub

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"karyoker" wrote in
message ...

Yes trying to remove duplicates... In the example above 3 Doors Down
has 2 songs and would like the dup artist listing removed... I thought
I could format col1 with *BOLD* but when the songs are moved to col1
they are formatted bold too....Actually I would just like the artists
to be underlined...


Thanks....


--
karyoker
------------------------------------------------------------------------
karyoker's Profile:

http://www.excelforum.com/member.php...o&userid=29417
View this thread: http://www.excelforum.com/showthread...hreadid=504281