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

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 2 Step -1
If Cells(i, "A").Value < Cells(i - 1, "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
End If
Cells(i, "B").Value = ""
Next i
End Sub


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"karyoker" wrote in
message ...

This is a short list.. Col1 and col2 are the only ones used....


+-------------------------------------------------------------------+
|Filename: Book2.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4265 |
+-------------------------------------------------------------------+

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

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