Sub Test()
If Intersect(ActiveCell, Range("MyRange")) Is Nothing Then
MsgBox "当前单元格不在MyRange中"
Else
MsgBox "当前单元格在MyRange中"
End If
End Sub
几句vba代码给你
dim Cel as Range
for each Cel in Range("MyRange")
if ActiveCell.Address=Cel.Address then msgbox ""
next