jeudi 13 août 2020

repeat a conditional formatting pattern

So originally I thought about doing just a conditional formatting, but since I have over 13,680 cells to be compared and 12 pages of data. I figured there has to be a way of writing a macro to do this for me. though I am struggling with the code to get it to do what I want.

So what I am trying to do is write a macro that looks at say column A cell 1 compares it to B1 if greater then shade the cell Red and repeat that all the way down A so A2 looks at B2 and A3 looks at B3 so on and so on.

Sub simple_if()
Dim cell As Range

If Range("R3") > ("S3") Then cell.Interior.Color = VBA.ColorConstants.vbRed
End If

Sub if_loop()

End Sub

Aucun commentaire:

Enregistrer un commentaire