Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm creating a form in Excel in which I want to validate data in a specific cell dependant of value of an option button elsewhere on the form. I,ve created code below, but despite the fact I'm not getting any VB errors there is no validation either, respectless of what value I put into subject cell or option button. Can somebody point me in the right direction here? Thx! Private Sub Worksheet_Change(ByVal target As Range) If target = "B16" Then If OptionButton1.Value = -1 Then With target.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="V6504:V7031" .IgnoreBlank = True .InCellDropdown = False .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "Niet goed. Nog een keer proberen" .ShowInput = True .ShowError = True End With End If End If End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I haven't looked at all your code but the first line probably should be:
If Target.Address(False, False) = "B16" Then " wrote: Hi, I'm creating a form in Excel in which I want to validate data in a specific cell dependant of value of an option button elsewhere on the form. I,ve created code below, but despite the fact I'm not getting any VB errors there is no validation either, respectless of what value I put into subject cell or option button. Can somebody point me in the right direction here? Thx! Private Sub Worksheet_Change(ByVal target As Range) If target = "B16" Then If OptionButton1.Value = -1 Then With target.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="V6504:V7031" .IgnoreBlank = True .InCellDropdown = False .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "Niet goed. Nog een keer proberen" .ShowInput = True .ShowError = True End With End If End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dependent Data Validation | Excel Discussion (Misc queries) | |||
Data validation dependent lists | Excel Discussion (Misc queries) | |||
dependent lists on data validation | Excel Discussion (Misc queries) | |||
Data Validation and Dependent Lists Q | Excel Worksheet Functions | |||
Data Validation & Dependent Lists | Excel Worksheet Functions |