View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
papou[_2_] papou[_2_] is offline
external usenet poster
 
Posts: 112
Default Verify correct cell

Hi
Dim ChkRng
Set ChkRng = Intersect(ActiveCell, Range("A1:A7"))
If ChkRng Is Nothing Then
MsgBox "Sorry, can't go further active cell is not in the required range"
Exit Sub
Else
'do your stuff
End If

HTH
Cordially
Pascal

"jnf40" a écrit dans le message de news:
...
I have a rectangle on Sheet1, when the user clicks this rectangle I want to
make sure they are in 1 of 7 cells that will receive the information they
will enter from a userform. If they are in one of these 7 cells the
userform
will load but if they are not a message will show that they are in the
wrong
cell and cannot enter the information. Can this be done?