Determining cursor position in a named range
Your question (as to what you want reported back to you) is not very clear
to me. Does this do what you want...
Sub WhereIsActiveCell()
Dim Status As String
If Intersect(Range("RngName"), ActiveCell.EntireRow) Is Nothing Then
Status = "ActiveCell's Row is not within the Named Range."
Else
Status = "The ActiveCell's Row is located within the Named Range."
End If
If Intersect(Range("RngName"), ActiveCell.EntireColumn) Is Nothing Then
Status = Status & vbLf & vbLf & _
"ActiveCell's Column is not within the Named Range."
Else
Status = Status & vbLf & vbLf & _
"The ActiveCell's Column is located within the Named Range."
End If
MsgBox Status
End Sub
--
Rick (MVP - Excel)
"John" wrote in message
...
what macro code do I use to find the row and column position of the cursor
in
a named range table on a worksheet?
If the cursor is not exatactly in the named range, I'd like to determine
the
row if that is win the table, the column if that is in the table, or if
both
are out of the table range.
I appreciate your help, -John
|