Wie wil er even naar volgende formule kijken.
Ik zit ergens met een klein probleempje, maar kan echt niet uitvinden wat er verkeerd is aan deze formule.
Sub Inkleuren()
ActiveSheet.Unprotect
Application.ScreenUpdating = False
Range("C4:AG15").Select
For Each cell_in_loop In Selection
If cell_in_loop.Value = ("V") Then
With cell_in_loop.Interior
.ColorIndex = 7
End With
End If
Next
For Each cell_in_loop In Selection
If cell_in_loop.Value = ("R") Then
With cell_in_loop.Interior
.ColorIndex = 15
End With
End If
Next
For Each cell_in_loop In Selection
If cell_in_loop.Value = ("ZE") Then
With cell_in_loop.Interior
.Cex = 27
End With
End If
Next
For Each cell_in_loop In Selection
If cell_in_loop.Value = ("") And cell_in_loop.Interior = 3 _
Or cell_in_loop.Value = ("") And cell_in_loop.Interior = 1 _
Or cell_in_loop.Value = ("") And cell_in_loop.Interior = 5 Then
With cell_in_loop.Interior
.Cex = 8
End With
End If
Next
ActiveSheet.Protect
End Sub
Ik zit ergens met een klein probleempje, maar kan echt niet uitvinden wat er verkeerd is aan deze formule.
Sub Inkleuren()
ActiveSheet.Unprotect
Application.ScreenUpdating = False
Range("C4:AG15").Select
For Each cell_in_loop In Selection
If cell_in_loop.Value = ("V") Then
With cell_in_loop.Interior
.ColorIndex = 7
End With
End If
Next
For Each cell_in_loop In Selection
If cell_in_loop.Value = ("R") Then
With cell_in_loop.Interior
.ColorIndex = 15
End With
End If
Next
For Each cell_in_loop In Selection
If cell_in_loop.Value = ("ZE") Then
With cell_in_loop.Interior
.Cex = 27
End With
End If
Next
For Each cell_in_loop In Selection
If cell_in_loop.Value = ("") And cell_in_loop.Interior = 3 _
Or cell_in_loop.Value = ("") And cell_in_loop.Interior = 1 _
Or cell_in_loop.Value = ("") And cell_in_loop.Interior = 5 Then
With cell_in_loop.Interior
.Cex = 8
End With
End If
Next
ActiveSheet.Protect
End Sub