View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Myrna Larson Myrna Larson is offline
external usenet poster
 
Posts: 863
Default ActiveCell.CurrentRegion property

The logic used to determine the current region is to start from the current
cell, then move out in all directions until you get to a region that is
completely enclosed by blank cells (or the edge of the sheet is reached). That
includes checking the cells that touch B3 only at their corners, i.e. A2, C2,
A4, and C4. There is data in A2, hence the result you show.

OTOH, if you were referring to B4, CurrentRegion would be B4 since there is no
data in any of the 8 contiguous cells (A3:C3,A4,C4,A5:C5).

What is your definition of CurrentRegion? Evidently it differs from
Microsoft's. Maybe it's no data in the cells immediately above, below, left,
and right, but the corners don't matter? If so, your code will have to check
each of the appropriate cells individually.

On Tue, 11 Jan 2005 01:46:11 +0800, "Microsoft Forum"
wrote:

Hi all,

I have a problem about the Activecell.CurrentRegion property.

Suppose the active sheet has the following data (A - C and 1 - 3 are column
and row headings respectively):

A B C
1 x y
2 z
3

If the active cell is on B2 then the activecell.currentregion will return
A1:B2, which is the one I anticipated.

However if the active cell is on B3 then activecell.currentregion will
return A1:B3, which is not the one I want. I want the property to return
only B3. How can I do it, or any other workaround? Thanks for your advice.

Frederick Chow
Hong Kong.