How to obtain the shortest range that encloses all the non empty cells?

  • Thread starter Thread starter Chip Pearson
  • Start date Start date
C

Chip Pearson

Faustino,

The UsedRange property will return the range of cells, from
top-left to bottom-right, that are used. E.g.,

MsgBox ActiveSheet.UsedRange.Address


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
Hi,

How to obtain the range in which cells are defined? I mean, the Sheet has a
huge number of rows and columns but you use a few of them. Suppose you fill
the cells D20 and H40, and all others are untouched. I need to obtain the
range (D20:H40) How can I do that without scanning all the universe of
cells...?

Thanks in advance
Faustino
 
Thanks for all Chip,
Can you point me to some links for introducing Excel Object model (and Excel
way of thinking) for Visual Basic programmers (I mean structured and OO
programmers)? I feel I don't have yet the BIG picture of the Excel as a
powerful UI tool for programmers...

Thanks again
Faustino
 
Back
Top