Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine top row and bottom row
Probably an easy for some but....
Can someone please tell me the code to identify the top row and the bottom row if the user clicks on rows 5 and drags to row 10? Thanks -- Andrew 090507 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine top row and bottom row
Do you mean the start and end rows of the selected area ?
selection.cells(1).row selection.cells(selection.cells.count).row Assuming it's not a multi-area selection. Tim "Andrew" wrote in message ... Probably an easy for some but.... Can someone please tell me the code to identify the top row and the bottom row if the user clicks on rows 5 and drags to row 10? Thanks -- Andrew 090507 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine top row and bottom row
Thanks Tim, While waiting I found some code and adapted it as follow. Dim LastRow As Long Dim LastCol As Long Dim N As Long N = Selection.Areas.Count Last_Row = Selection.Areas(N).Cells(Selection.Areas(N).Rows.C ount, 1).Row No_Rows = Selection.Areas(N).Rows.Count First_Row = Last_Row - No_Rows + 1 I just finished when I got your reply. Thanks anyway -- Andrew "Tim" wrote: Do you mean the start and end rows of the selected area ? selection.cells(1).row selection.cells(selection.cells.count).row Assuming it's not a multi-area selection. Tim "Andrew" wrote in message ... Probably an easy for some but.... Can someone please tell me the code to identify the top row and the bottom row if the user clicks on rows 5 and drags to row 10? Thanks -- Andrew 090507 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Top 5 vs Bottom 5 | Excel Discussion (Misc queries) | |||
Top 10% and Bottom 10% | Excel Worksheet Functions | |||
dislike jump bottom of column by double-clicking the bottom of cel | Excel Discussion (Misc queries) | |||
how to paste data from top to bottom to bottom to top | Excel Discussion (Misc queries) | |||
bottom row | Excel Programming |