View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default determine whether the activecell is on the top or bottom

Just to you know, the ActiveCell can be located interior to the Selection
(make a Selection and then press the Tab key a few times). Given that, here
is some code you can use...

Location = InStr(Selection.Address, ActiveCell.Address)
If Location = 0 Then
MsgBox "ActiveCell is not at either end of the Selection"
ElseIf Location = 1 Then
MsgBox "ActiveCell is at the beginning of the Selection"
Else
MsgBox "ActiveCell is at the end of the Selection"
End If

--
Rick (MVP - Excel)


"John Smith" wrote in message
...
In a user selected single column selection, how do I determine
whether the activecell is on the top or bottom of the selection?
Thanks.