Hello everyone,
I'm using the following to validate entries on a spreadsheet before saving:
I though of the following but it's not very practical..
Any help would be really appreciated. Sorry I just started looking into this today, for this project.
Best,
Nick
I'm using the following to validate entries on a spreadsheet before saving:
However, I cannot find the way to make a loop - Need this to run for each row.If IsEmpty(Range("A2").Value) = False Then
If IsEmpty(Range("B2").Value) = True Or IsEmpty(Range("C2").Value) = True Or IsDate(Range("D2").Value) = False Or IsDate(Range("E2").Value) = Fale Or IsEmpty(Range("G2").Value) = True Or IsEmpty(Range("H2").Value) = True Or IsNumeric(Range("I2").Value) = False Then
MsgBox "One or more incorrect entries found in row 2."
Cancel = True
End If
End If
I though of the following but it's not very practical..
If IsEmpty(Range("A2").Value) = False Then
If IsEmpty(Range("B2").Value) = True Or IsEmpty(Range("C2").Value) = True Or IsDate(Range("D2").Value) = False Or IsDate(Range("E2").Value) = Fale Or IsEmpty(Range("G2").Value) = True Or IsEmpty(Range("H2").Value) = True Or IsNumeric(Range("I2").Value) = False Then
MsgBox "One or more incorrect entries found in row 2."
Cancel = True
End If
End If
If IsEmpty(Range("A3").Value) = False Then
If IsEmpty(Range("B3").Value) = True Or IsEmpty(Range("C3").Value) = True Or IsDate(Range("D3").Value) = False Or IsDate(Range("E3").Value) = Fale Or IsEmpty(Range("G3").Value) = True Or IsEmpty(Range("H3").Value) = True Or IsNumeric(Range("I3").Value) = False Then
MsgBox "One or more incorrect entries found in row 3."
Cancel = True
End If
End If
If IsEmpty(Range("A4").Value) = False Then
If IsEmpty(Range("B4").Value) = True Or IsEmpty(Range("C4").Value) = True Or IsDate(Range("D4").Value) = False Or IsDate(Range("E4").Value) = Fale Or IsEmpty(Range("G4").Value) = True Or IsEmpty(Range("H4").Value) = True Or IsNumeric(Range("I4").Value) = False Then
MsgBox "One or more incorrect entries found in row 4."
Cancel = True
End If
End If
Any help would be really appreciated. Sorry I just started looking into this today, for this project.
Best,
Nick