View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jamey Weare Jamey Weare is offline
external usenet poster
 
Posts: 8
Default IF statements referencing an absolute value or a range of values

Public Sub validate()
Dim validation As Integer
Dim row As Integer
Dim col As Integer

row = 5
col = 1
validation = ActiveSheet.Cells(row, col).Value

If validation -5 And validation < 5 Then
MsgBox ("OK")
Else
MsgBox ("Validation Error")
End If

End Sub


skaminski wrote:
Does anyone know how to create a conditional statement for the following
situation?

If the value in a particular cell is between -5 and 5, then return a message
that says "ok", otherwise return a message that says "validation error".