ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Range of cell (https://www.excelbanter.com/excel-programming/276200-range-cell.html)

andres a

Range of cell
 
Hello everyone:

How can I know if the ranage selected is more than one
cell or a selection of diffrent ranges?

Cheers,

Andres

Jerry Park

Range of cell
 
Andres A wrote:
Hello everyone:

How can I know if the ranage selected is more than one
cell or a selection of diffrent ranges?

Cheers,

Andres

RangeName.Count 1


JohnI in Brisbane

Range of cell
 
Andres,

Forgot to answer the first part of your question.

"selection.rows.count" AND "selection.columns.count" will tell you if there
is more than 1 cell in the range.

"Selection.cells.Count" gives the total number of cells in the total
selection.

regards

JohnI

"Andres A" wrote in message
...
Hello everyone:

How can I know if the ranage selected is more than one
cell or a selection of diffrent ranges?

Cheers,

Andres




JohnI in Brisbane

Range of cell
 
Tom,

Thanks for that. I should have tested. I was going from memory which in this
case was faulty.

regards,

JohnI


"Tom Ogilvy" wrote in message
...
"selection.rows.count" AND "selection.columns.count" will tell you if

there
is more than 1 cell in the range.



? Range("A1,C9:M15,Z20").Rows.count
1

? range("A1,c9:M15,Z20").Columns.Count
1

You are correct aboutn

? range("A1,c9:M15,Z20").Count
79

--
Regards,
Tom Ogilvy



"JohnI in Brisbane" wrote in message
...
Andres,

Forgot to answer the first part of your question.

"selection.rows.count" AND "selection.columns.count" will tell you if

there
is more than 1 cell in the range.

"Selection.cells.Count" gives the total number of cells in the total
selection.

regards

JohnI

"Andres A" wrote in message
...
Hello everyone:

How can I know if the ranage selected is more than one
cell or a selection of diffrent ranges?

Cheers,

Andres









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

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