Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using the three lines below to select all of the cells in a worksheet
table that have data. Range("E7").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select This line gives me the row number of the last row in the selection, but I can't figure out how to get the column number of the last column in the selection. cRows = Cells(Rows.Count, "A").End(xlUp).Row Any ideas ? thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this Andy
MsgBox Selection.Cells(Selection.Cells.Count).Column -- Regards Ron de Bruin http://www.rondebruin.nl "Andy K" <Andy wrote in message ... I'm using the three lines below to select all of the cells in a worksheet table that have data. Range("E7").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select This line gives me the row number of the last row in the selection, but I can't figure out how to get the column number of the last column in the selection. cRows = Cells(Rows.Count, "A").End(xlUp).Row Any ideas ? thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks !!
"Ron de Bruin" wrote: Try this Andy MsgBox Selection.Cells(Selection.Cells.Count).Column -- Regards Ron de Bruin http://www.rondebruin.nl "Andy K" <Andy wrote in message ... I'm using the three lines below to select all of the cells in a worksheet table that have data. Range("E7").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select This line gives me the row number of the last row in the selection, but I can't figure out how to get the column number of the last column in the selection. cRows = Cells(Rows.Count, "A").End(xlUp).Row Any ideas ? thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatic Selection of Multiple Rows | Excel Worksheet Functions | |||
Looping a selection of rows | Excel Discussion (Misc queries) | |||
Selection of Rows | Excel Programming | |||
Get rows which match selection criteria | Excel Programming | |||
Selection.End(xlDown) with Rows selected | Excel Programming |