Good morning,
I am trying to make a VBA code to check if the out time has been filled in if there was an in time. If the out time has been left blank the 2 cells need to become yellow when afterwards the cell gets filled in by the user the color needs to disappear. Therefor I am trying to use Conditional formatting in my VBA code but I can't seem to get it working.
this is the code I use so far:
could anybody help with this?
I am trying to make a VBA code to check if the out time has been filled in if there was an in time. If the out time has been left blank the 2 cells need to become yellow when afterwards the cell gets filled in by the user the color needs to disappear. Therefor I am trying to use Conditional formatting in my VBA code but I can't seem to get it working.
this is the code I use so far:
Code:
Set v_laatstecel = [b65536].End(xlUp)
Set v_gebied = Range([b5], v_laatstecel)
For Each v_cel In v_gebied
Set v_in = v_cel.Offset(0, 6) 'in times
Set v_uit = v_cel.Offset(0, 7) 'out times
If IsEmpty(v_in) Then
Else
If IsEmpty(v_uit) Then
v_uur = v_in.Value
v_in = v_date - 1 & " " & v_uur
v_rij = v_cel.Row
Range(v_in, v_uit).FormatConditions.Add Type:=xlExpression, Formula1:="=ISBLANK(" & v_uit & ")"
With Selection.FormatConditions(1)
.Interior.Color = 36
.StopIfTrue = True
End With
could anybody help with this?