View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Andy K[_2_] Andy K[_2_] is offline
external usenet poster
 
Posts: 2
Default getting the column and rows from a selection

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.