'Laatste rij bepalen
nRow = Cells(6, 2).End(xlDown).Row
nCol = Cells(2, 1).End(xlToRight).Column
For r = nRow To 6 Step -1
If IsEmpty(Cells(r, 1)) Then
MijnDate = Cells(r, 2)
Cells(r, 1) = DagNaam(MijnDate)
'voorwaardelijke opmaak toevoegen
Range(Cells(r, 1), Cells(r, 10)).FormatConditions.Delete
Range(Cells(r, 1), Cells(r, 10)).FormatConditions.Add Type:=xlExpression, Formula1:= _
"=$B1=vandaag()"
Range(Cells(r, 1), Cells(r, 10)).FormatConditions(1).Interior.ColorIndex = 3
Range(Cells(r, 1), Cells(r, 10)).FormatConditions.Add Type:=xlExpression, Formula1:="=$B1<>"""""
With Range(Cells(r, 1), Cells(r, 10)).FormatConditions(2).Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Range(Cells(r, 1), Cells(r, 10)).FormatConditions(2).Borders(xlRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Range(Cells(r, 1), Cells(r, 10)).FormatConditions(2).Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Range(Cells(r, 1), Cells(r, 10)).FormatConditions(2).Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next