Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default Multiple Data Validation

Hello,
Is it possible to have multiple validation rules per cell? I would like it
if I could give a warning if the input was within a certain range of values,
and a stop message if it was between another.
Thank you.
Richard.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Multiple Data Validation

Don't think so using DV, you could do it with VBA.

--
__________________________________
HTH

Bob

"VoxBox-Richard" wrote in message
...
Hello,
Is it possible to have multiple validation rules per cell? I would like
it
if I could give a warning if the input was within a certain range of
values,
and a stop message if it was between another.
Thank you.
Richard.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default Multiple Data Validation

Can you any help me doing in using VB then? Or provide me a link explaining
how to do it.

Cheers.
R.


"Bob Phillips" wrote:

Don't think so using DV, you could do it with VBA.

--
__________________________________
HTH

Bob

"VoxBox-Richard" wrote in message
...
Hello,
Is it possible to have multiple validation rules per cell? I would like
it
if I could give a warning if the input was within a certain range of
values,
and a stop message if it was between another.
Thank you.
Richard.




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Multiple Data Validation

Something like this

Option Explicit

Private mmPrev As Variant

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target

'reject check
If .Value < 0 Or .Value 10 Then

MsgBox "Invalid value", vbOKOnly, "Input Error"
.Value = mmPrev
ElseIf .Value 5 Then

MsgBox "Value may be too high", vbOKOnly, "Input Warning"
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
mmPrev = Target.Value
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--
__________________________________
HTH

Bob

"VoxBox-Richard" wrote in message
...
Can you any help me doing in using VB then? Or provide me a link
explaining
how to do it.

Cheers.
R.


"Bob Phillips" wrote:

Don't think so using DV, you could do it with VBA.

--
__________________________________
HTH

Bob

"VoxBox-Richard" wrote in
message
...
Hello,
Is it possible to have multiple validation rules per cell? I would
like
it
if I could give a warning if the input was within a certain range of
values,
and a stop message if it was between another.
Thank you.
Richard.






Reply
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
multiple choice data validation creativeops Excel Discussion (Misc queries) 5 September 14th 07 09:21 AM
Multiple Data Validation betany70 Excel Discussion (Misc queries) 2 July 24th 07 09:42 PM
Data Validation - Multiple Dependencies Nimish Excel Discussion (Misc queries) 0 August 11th 06 03:47 PM
Data Validation - Multiple Options LPS Excel Discussion (Misc queries) 8 August 11th 06 03:16 PM
Multiple Data Validation Criterias MCorrea Excel Worksheet Functions 4 January 20th 05 07:17 PM


All times are GMT +1. The time now is 03:16 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"