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

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)
 
F

faustino Dina

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
 
F

faustino Dina

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top