View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Paul Paul is offline
external usenet poster
 
Posts: 1
Default Auto format sheet


The following code should work:


Code:
--------------------


Sub reformat()
Dim i As Long
For i = 1 To Range("A" & Rows.Count).End(xlUp).Row
If Cells(i, 1).Value = 2 And Cells(i, 1).Value <= 4 Then
Cells(i, 2).Value = Space(5 * (Cells(i, 1).Value - 1)) & Cells(i, 2).Value
End If
If Cells(i, 2).Font.Bold = True Then Cells(i, 2).EntireRow.Interior.ColorIndex = 15
Next i
End Sub
--------------------


--
Paul

- Paul
------------------------------------------------------------------------
Paul's Profile: 1697
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=192571

http://www.thecodecage.com/forumz