LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Data validation dependent of value of option button

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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dependent Data Validation Shacks Excel Discussion (Misc queries) 3 August 12th 09 06:58 PM
Data validation dependent lists Negative numbers in brackets Excel Discussion (Misc queries) 4 November 9th 07 06:11 AM
dependent lists on data validation Chris Excel Discussion (Misc queries) 3 November 8th 07 12:03 AM
Data Validation and Dependent Lists Q Sean Excel Worksheet Functions 4 May 19th 07 07:19 PM
Data Validation & Dependent Lists Bob Excel Worksheet Functions 3 December 21st 06 02:38 PM


All times are GMT +1. The time now is 07:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"