antonhoward
New Member
- Joined
- Jan 24, 2008
- Messages
- 9
Hello,
Can someone please respond as I'm going nuts here.
I have a macro written that creates data validation in a spreadsheet. The Validation boxes are dependant on the previous box being filled in and I've used the indirect function for this.
The first validation boxes create fine being populated with a named range, however in the dependant validation boxes that follow I get the error "The source currently evaluates to an error, do you wish to continue" because a selection from the first box has not yet been made.
I need to stop this error from appearing or bypass it in some way using the macro but I'm lost.
Range("C81:D81").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=division"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Range("E81:F81").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=indirect($C$81)"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = False
End With
Range("G81:H81").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=indirect($E$81)"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = False
End With
Please help
Can someone please respond as I'm going nuts here.
I have a macro written that creates data validation in a spreadsheet. The Validation boxes are dependant on the previous box being filled in and I've used the indirect function for this.
The first validation boxes create fine being populated with a named range, however in the dependant validation boxes that follow I get the error "The source currently evaluates to an error, do you wish to continue" because a selection from the first box has not yet been made.
I need to stop this error from appearing or bypass it in some way using the macro but I'm lost.
Range("C81:D81").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=division"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Range("E81:F81").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=indirect($C$81)"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = False
End With
Range("G81:H81").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=indirect($E$81)"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = False
End With
Please help