View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] joeu2004@hotmail.com is offline
external usenet poster
 
Posts: 418
Default How to detect last row of Selection?

I want to have the following loop:

for each cell in Selection
if 'cell in last row in Selection' and 'condition based on cell.value'
then
' process cell in last row
else
' process other cells normally
end if
next

How do I implement the test "cell in last row in Selection"?

Note: Selection is an n-by-m area. So simply testing
"something = last cell of Selection" will not suffice. I need
to recognize any cell in the last row.

Besides, I don't even know how to implement "something =
last cell of Selection". I don't know how to write "something"
(some property of cell?); and I don't know how to write "last
cell of Selection". (Klunk!).

For my edification, I would appreciate it if someone would
tell me how to implement "something = last cell in Selection",
even though that does not address my original problem
above.