View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
pablo pablo is offline
external usenet poster
 
Posts: 76
Default Determining Cell within Range

I am needing to determine if a selected cell is within a certain range. Below
is something that I have tried, but it only returns a 400 error.

Sub FindRange()
Dim rngMyRange As Range

Set rngMyRange = Worksheets("Sheet1").Range(A1, G20)

If ActiveCell.Select = rngMyRange Then
MsgBox ("Good Job")
Else
MsgBox ("Out of Bounds")
End If

End Sub