View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
monir monir is offline
external usenet poster
 
Posts: 215
Default Orderly Validation Against Separate Ranges

Hello;

I would like to check the values in 3 cells, each against a separate range
of values, before proceeding with the computation. (And not using Data
Validation Lists).

Suppose the 3 cells to be checked, in the order presented, a
.... C9, C10, and C11
and their validation ranges a
.... A1:A5, B1:B6, and C1:C7 respectively.

I would appreciate your help to include in the VBA code something like:
IF Range("C9").Value < 'any value in the Range("A1:A5") Then
MsgBox "You must Change C9 value"
' don't exit this IF until you fix the value in C9
Enf IF
IF Range("C10").Value < 'any value in Range("B1:B6") Then
MsgBox "You must Change C10 value"
' don't exit this IF until you fix the value in C10
Enf IF
IF Range("C11").Value < 'any value in Range("C1:C7") Then
MsgBox "You must Change C11 value"
' don't exit this IF until you fix the value in C11
Enf IF
'continue with the program

Thank you.