View Single Post
  #30   Report Post  
Posted to microsoft.public.excel.programming
Howard Kaikow Howard Kaikow is offline
external usenet poster
 
Posts: 269
Default RowHeight and AutoFit wit Merged Cells

"Peter T" <peter_t@discussions wrote in message
...
I stick by the 255 address limit but you may have misunderstood what I

meant
by "up to 16 areas anywhere on the sheet". The key word is "anywhere",

also
although not stated each area with two or more cells below and to the

right
of AA10000 with an address like "AA12345:AB12345".


The length is not limited to 255 in Excel 97.
Run the example I posted to see this.


If areas are above and to left of AA10000 and/or are single cell areas,

more
than 16 areas can be defined within a 255 address.


The absolute max number of areas defineable within the 255 address limit

is
85, albeit highly contived


I believe that the limit is the string length, not the nimber of areas.

The 255 address limit is well documented for all versions (I think also
2007). The 255 limit also applies to some other things such as refersto
strings in names, however the actual limit may be less. For my purposes I
consider an absolute safe llimit at 230.


The documentation is incorrect.

No, don't brute force like that. Apart from being unnecessarily slow, with
certain combinations the range can be successfully set with an address
truncated shorter than the original 255+ string, down to 255 or less.


It is not slow.
How can one shorten the string?
All areas are two consecutive cells, up to 4 per row, every Nth row.

I
suspect that is what has made you think you can define more areas in XL97
than in 2003. It's a while since I tested but there is a difference in how
this "truncating" can occur between versions.


I stated that the string can be longer.
Run my exanple in Excek 97 to see this.

Keep track of the address length as you go. When it's known that adding

one
more area will exceed 255, process the <=255 chunck.


That does not work because the limit may be different in each version of
Excel.

Debug.Print rng.Areas.count, Len(rng.Address(0, 0))


I've already done that.