|
-
Nov 19th, 2002, 05:42 AM
#1
Thread Starter
Frenzied Member
** RESOLVED ** Excel Range - Getting start and end row
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
Thanks in advance ....
Last edited by TheBionicOrange; Nov 19th, 2002 at 06:15 AM.
-
Nov 19th, 2002, 05:53 AM
#2
Lively Member
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.
You are living a pacifist dream, and if you dreaming it means you sleeping and you should damn well wake up!
-
Nov 19th, 2002, 06:01 AM
#3
Thread Starter
Frenzied Member
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.
-
Nov 19th, 2002, 06:02 AM
#4
Lively Member
apologies
I realise that I misread your question.
You are living a pacifist dream, and if you dreaming it means you sleeping and you should damn well wake up!
-
Nov 19th, 2002, 06:14 AM
#5
Thread Starter
Frenzied Member
OK found the syntax ..... easy when you know how
VB Code:
objexcel.selection.address
This returns an address in R1C1 notation e.g. $A$4:$Y$65536
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|