ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to obtain the shortest range that encloses all the non empty cells? (https://www.excelbanter.com/excel-programming/273367-how-obtain-shortest-range-encloses-all-non-empty-cells.html)

Chip Pearson

How to obtain the shortest range that encloses all the non empty cells?
 
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


"faustino Dina" wrote in message
...
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





faustino Dina

How to obtain the shortest range that encloses all the non empty cells?
 
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



faustino Dina

How to obtain the shortest range that encloses all the non empty cells?
 
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

"Chip Pearson" wrote in message
...
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


"faustino Dina" wrote in message
...
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








All times are GMT +1. The time now is 05:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com