ballgameaddictus
New Member
- Joined
- Oct 17, 2008
- Messages
- 11
I don't profess to be an expert with VBA... so I'm asking the experts!
I have a huge spreadsheet and in column B, I have three names that are repeated... for ease of reference I'll call them Ann, Betsy and Charlie.
For each occurance of Ann, I need to highlight the row in gray; for each occurrence of Betsy, I need to format all cells in that row to be currency and for each occurrance of Charlie, I need to change it to number format.
I have tried working with this and I've got the VBA to work - kinda! But once I add my second condition - it over-rides the first.
I've searched and searched for hours now and tried several different things but can't get anything to work.
Please help!!
I have a huge spreadsheet and in column B, I have three names that are repeated... for ease of reference I'll call them Ann, Betsy and Charlie.
For each occurance of Ann, I need to highlight the row in gray; for each occurrence of Betsy, I need to format all cells in that row to be currency and for each occurrance of Charlie, I need to change it to number format.
I have tried working with this and I've got the VBA to work - kinda! But once I add my second condition - it over-rides the first.
I've searched and searched for hours now and tried several different things but can't get anything to work.
Please help!!
With Cells.FormatConditions
.Delete
.Add Type:=xlExpression, _
Formula1:="=COUNTIF(R[]:R[],""Ann"")"
.Item(1).Interior.ColorIndex = 15
End With
With Cells.FormatConditions
.Delete
.Add Type:=xlExpression, _
Formula1:="=COUNTIF(R[]:R[],""Betsy"")"
.Item(1).NumberFormat = "$#,##0.00"
End With