C
Claude
Hi all,
I have a strange problem: when I set the data validation
manually on a specific cell, this works without problems.
However, when I record the macro and try to execute the
code, I get an "application or object defined error" (on
the .Add bit).
Is there anything wrong with the following code?
Sub Macro7()
With Selection.Validation
.Delete
.Add Type:=xlValidateCustom,
AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=A1=round(A1;2)"
.IgnoreBlank = False
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "Input error"
.InputMessage = ""
.ErrorMessage = "Please enter amounts rounded to
not more than 2 decimals!"
.ShowInput = False
.ShowError = True
End With
End Sub
I have a strange problem: when I set the data validation
manually on a specific cell, this works without problems.
However, when I record the macro and try to execute the
code, I get an "application or object defined error" (on
the .Add bit).
Is there anything wrong with the following code?
Sub Macro7()
With Selection.Validation
.Delete
.Add Type:=xlValidateCustom,
AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=A1=round(A1;2)"
.IgnoreBlank = False
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "Input error"
.InputMessage = ""
.ErrorMessage = "Please enter amounts rounded to
not more than 2 decimals!"
.ShowInput = False
.ShowError = True
End With
End Sub