I have the following macro:
Sub verificaCNP()
Dim lr As Long
lr = Range("A" & Rows.Count).End(xlUp).Row
For Each c In Range("G3:G" & lr).Cells
If c.Value <> "" Then
c.Activate
ActiveCell.Interior.ColorIndex = xlColorIndexNone
If Len(ActiveCell.Value) <> 13 Then
'MsgBox (ActiveCell.Value & ": CNP incorect - nu are 13 caractere")
ActiveCell.Interior.ColorIndex = 3
ActiveCell.Activate
Exit Sub
Else
If Not VerificCnp(ActiveCell.Value) Then
'MsgBox (ActiveCell.Value & ": CNP incorect.")
ActiveCell.Interior.ColorIndex = 3
ActiveCell.Activate
Exit Sub
End If
End If
End If
Next c
End Sub
I want this macro to be modified in order to rule for the current date only (the date is mentioned in column B)
Sub verificaCNP()
Dim lr As Long
lr = Range("A" & Rows.Count).End(xlUp).Row
For Each c In Range("G3:G" & lr).Cells
If c.Value <> "" Then
c.Activate
ActiveCell.Interior.ColorIndex = xlColorIndexNone
If Len(ActiveCell.Value) <> 13 Then
'MsgBox (ActiveCell.Value & ": CNP incorect - nu are 13 caractere")
ActiveCell.Interior.ColorIndex = 3
ActiveCell.Activate
Exit Sub
Else
If Not VerificCnp(ActiveCell.Value) Then
'MsgBox (ActiveCell.Value & ": CNP incorect.")
ActiveCell.Interior.ColorIndex = 3
ActiveCell.Activate
Exit Sub
End If
End If
End If
Next c
End Sub
I want this macro to be modified in order to rule for the current date only (the date is mentioned in column B)