View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Executor Executor is offline
external usenet poster
 
Posts: 74
Default macro creation to format mulitple rows in a list *difficult*

Hi TroyT,

I have cooked something for you:

Sub InsertCells()

Range("A2").Select ' or any other cell to start

Do
Select Case StrComp(ActiveCell.Value, ActiveCell.Offset(0,
1).Value, vbTextCompare)
Case 1
Range(ActiveCell, ActiveCell.End(xlDown)).Select
Selection.Cut Destination:=ActiveCell.Offset(1, 0)
ActiveCell.Interior.Color = vbGreen
Case -1
Range(ActiveCell.Offset(0, 1), ActiveCell.Offset(0,
1).End(xlDown)).Select
Selection.Cut Destination:=ActiveCell.Offset(1, 0)
ActiveCell.Interior.Color = vbRed
ActiveCell.Offset(0, -1).Select
Case 0
End Select
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell) Or IsEmpty(ActiveCell.Offset(0, 1))
End Sub

Hoop This Helps,

Executor