If a range is highlighted in Excel, does anyone know how to get at the start row and the end row of the selection ?
Its probably obvious, but I can't find it yet :rolleyes:
Thanks in advance ....
Printable View
If a range is highlighted in Excel, does anyone know how to get at the start row and the end row of the selection ?
Its probably obvious, but I can't find it yet :rolleyes:
Thanks in advance ....
Range("F12:G17").Select is the select code. then just play with the actual parameters.
so now if you dont know the start and end row, just read each cell one at a time until the contents of a cell are null, and keep incrementing a counter. that assumes that all the cells are filled consecutively and then it breaks at a null.
The problem is I don't the range. I am using :
VB Code:
objExcel.Range(Selection, Selection.End(xlDown)).Select
due to variable length data.
Under certain conditions it will jump to row 65536. This is what I need to trap.
I realise that I misread your question.:rolleyes:
OK found the syntax ..... easy when you know how :D
VB Code:
objexcel.selection.address
This returns an address in R1C1 notation e.g. $A$4:$Y$65536
:)