K
KAH
I want to write a function to colour a given cell based on the value of a
variables. Below if what I have so far. But I am not sure how to define the
function or how to use cells in functions. Any assistance is appreciated.
If wsResults.Cells(x, y).Value < (z) Then
Cells(x,y).Select
With Selection.Interior
.ColorIndex = 37
.Pattern = xlSolid
End With
ElseIf wsResults.Cells(x,y).Value > (z) Then
Cells(x,y).Select
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
End If
variables. Below if what I have so far. But I am not sure how to define the
function or how to use cells in functions. Any assistance is appreciated.
If wsResults.Cells(x, y).Value < (z) Then
Cells(x,y).Select
With Selection.Interior
.ColorIndex = 37
.Pattern = xlSolid
End With
ElseIf wsResults.Cells(x,y).Value > (z) Then
Cells(x,y).Select
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
End If