I'm new to excel vba. I'm tried out the vba code for changing cells
color but it don't work if my cells contains a if formula (eg. all
cells in cloumn A contain =if(and(b1="Rej",c1="Rej"),"Rej",....). Any
idea what should be the code?
I'm new to excel vba. I'm tried out the vba code for changing cells
color but it don't work if my cells contains a if formula (eg. all
cells in cloumn A contain =if(and(b1="Rej",c1="Rej"),"Rej",....). Any
idea what should be the code?
Perhaps this little code snippet will point you in the right direction:
Sub FormulaCellColor()
Dim varVal As Variant
Dim strCell As String
Dim r As Range
Range("A1").Select
varVal = ActiveCell.Value
Do Until varVal = ""
Set r = ActiveCell
If r.HasFormula Then
With r
.Interior.Color = vbBlue
.Font.Color = vbWhite
End With
End If
ActiveCell.Offset(1).Select
Loop
Set r = Nothing
End Sub
--
Kevin Backmann
"dot" wrote:
> I'm new to excel vba. I'm tried out the vba code for changing cells
> color but it don't work if my cells contains a if formula (eg. all
> cells in cloumn A contain =if(and(b1="Rej",c1="Rej"),"Rej",....). Any
> idea what should be the code?
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks