A
anita
Hi,
I made this macro and it works (see: Sub eentjestest()). If there's a
cell that has no color, the cell value will be 1. But I also want to
query on borders, so if the cell has borders then the cell must get the
value 1. Does anybody know how to solve this?
Sub eentjestest()
Dim d As Range
Set d = Range("A1:BE3000")
For Each c In d
x = c.Interior.ColorIndex
If x = xlNone Then
c.FormulaR1C1 = "1"
End If
Next c
MsgBox ("Finished 1-test")
End Sub
The borders are something like this (but if I add it, it won't work):
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub
I made this macro and it works (see: Sub eentjestest()). If there's a
cell that has no color, the cell value will be 1. But I also want to
query on borders, so if the cell has borders then the cell must get the
value 1. Does anybody know how to solve this?
Sub eentjestest()
Dim d As Range
Set d = Range("A1:BE3000")
For Each c In d
x = c.Interior.ColorIndex
If x = xlNone Then
c.FormulaR1C1 = "1"
End If
Next c
MsgBox ("Finished 1-test")
End Sub
The borders are something like this (but if I add it, it won't work):
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub