Hello
I have been building a macro to add an up arrow to cells in a range if criteria is met. I have tried to add another line to add a down arrow if other criteria is met.
The macro works ok when I just have the code for either the up arrow or the down arrow but doesn't work when I have both lines together. The second line to insert the down arrow does insert the arrow but it doesn't seem to take the criteria into account.
I've done some research and I think I need to add either Else or ElseIf in somewhere but no matter what I've tried I can't get it to work.
Can anyone point me in the right direction?
Thank you
I have been building a macro to add an up arrow to cells in a range if criteria is met. I have tried to add another line to add a down arrow if other criteria is met.
The macro works ok when I just have the code for either the up arrow or the down arrow but doesn't work when I have both lines together. The second line to insert the down arrow does insert the arrow but it doesn't seem to take the criteria into account.
I've done some research and I think I need to add either Else or ElseIf in somewhere but no matter what I've tried I can't get it to work.
Can anyone point me in the right direction?
Thank you
VBA Code:
Sub Highlight12MonthVariance()
Application.ScreenUpdating = False
Dim cel As Range
For Each cel In ThisWorkbook.Sheets("Summary").Range("B10:B34")
On Error Resume Next
If Application.WorksheetFunction.IsText(cel) = True Then If Sheets(cel.Text).Range("I47") >= Sheets(cel.Text).Range("I44") * 1.1 Then cel.Value = cel.Value & " " & ChrW(8679)
If Application.WorksheetFunction.IsText(cel) = True Then If Sheets(cel.Text).Range("I47") <= Sheets(cel.Text).Range("I44") * 0.9 Then cel.Value = cel.Value & " " & ChrW(8681)
Next cel
Application.ScreenUpdating = True
End Sub