Ranges vs cells with VBA
Okay, if I disable the events and clear the area and then enable the events
the problem goes away. How can I handle the situation if the user manually
tries to clear all the cells at once (because then I still get hung up in the
original if statement.
Sub ClearSingle()
Application.EnableEvents = False
shtSingleDeposits.Range("B4:C8").ClearContents
shtInput.Range("InpSingleInd") = "No"
Application.EnableEvents = True
End Sub
--
Wag more, bark less
"Brad" wrote:
If I delete each cell in a range manually - I do not get hung up in the
below "if statement". If try to "clearcontents" to the entire range - it
doesn't recognize the isEmpty(Target.value) (I believe). What options do I
have...
If Target.Column = 2 And Not IsDate(Target.Value) And Not
IsEmpty(Target.Value) Then
MsgBox ("Inputs have to be dates")
Target.ClearContents
End If
|