View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Xispo[_8_] Xispo[_8_] is offline
external usenet poster
 
Posts: 1
Default Excel VBA - If Else problem - HELP PLEASE

I am trying to write some code where I start the cursor in a workbook,
and it loops down until the cell in that column is empty changing the
colours of the cells on the way depending what is in the cell. Here is
my attempted effort. Any help would be great, Thanks

Do

If IsEmpty(ActiveCell) = False Then

ElseIf ActiveCell = "zone total" Then
ActiveCell.Select
With Selection.Interior
ColorIndex = 12
Pattern = xlSolid
ActiveCell.Offset(1, 0).Select

ElseIf ActiveCell = "regional total" Then
ActiveCell.Select
With Selection.Interior
ColorIndex = 45
Pattern = xlSolid
ActiveCell.Offset(1, 0).Select


Else
ActiveCell.Select
With Selection.Interior
ColorIndex = 3
Pattern = xlSolid
ActiveCell.Offset(1, 0).Select

End If

Loop Until IsEmpty(ActiveCell) = True

End Sub:)


---
Message posted from http://www.ExcelForum.com/