PDA

View Full Version : How to edit the color of the cell?



idnoidno
05-18-2017, 06:32 AM
If mar(i, 7) = "" Then mar(i, 7) = .Cells(1, 5)
End If


If mar (i, 7) = .Cells (1, 5), how to let mar (i, 7) cell color become red?

mdmackillop
05-18-2017, 10:00 AM
mar(i,7) is not a cell but an array member.

SamT
05-18-2017, 10:08 AM
What's a mar?


Sheets("Sheet1").Cells(13, 7).Interior.ColorIndex = 3

idnoidno
05-20-2017, 05:12 PM
The mar is a array.


If mar(i, 8) = "" Then
mar(i, 8) = .Cells(1, 6)
.Cells(i , 8).Font.Color = vbRed
End If


It works but is it correct?:think:

SamT
05-21-2017, 03:54 AM
If it works, then it is correct