View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default regions in excel

One way:

Dim rng As Range
Set rng = ActiveSheet.Range("A1:J10")

'Top Left
Debug.Print rng(1).Address

'Bottom Right
Debug.Print rng(rng.Count).Address

'Top Right
Debug.Print rng(1, rng.Columns.Count).Address

'Bottom Left
Debug.Print rng(rng.Rows.Count, 1).Address

Result:

$A$1
$J$10
$J$1
$A$10

In article ,
"Sean Farrow" wrote:

Hi:
is it possible to obtain the individual top and left addressesof a region,
if not how ae these presented in the address. How would one derive the
bottom and right co-ordinates?
Cheers
Sean.
"JE McGimpsey" wrote in message
...
The address property for a multi-cell range returns upper-left and
lower-right cells in the range. You can, of course, easily derive the
upper-right and lower-left addresses.



In article ,
"Sean Farrow" wrote:

Thanks for that, I take it the Address property would give the address of
the cells at the four courners of the region?