ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Determining the size of a range. (https://www.excelbanter.com/excel-programming/302807-determining-size-range.html)

Dave the wave

Determining the size of a range.
 
Is there a means for discovering the size of a particular range? (Like, how
many rows or columns are in the range.) (Using VBA, of course.)

--
from
Dave the wave~~~~~



Bob Phillips[_6_]

Determining the size of a range.
 

iRows=Selection.Rows.Count
iColumns = Selection.Columns.Count

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Dave the wave" wrote in message
...
Is there a means for discovering the size of a particular range? (Like,

how
many rows or columns are in the range.) (Using VBA, of course.)

--
from
Dave the wave~~~~~





Dave the wave

Determining the size of a range.
 
Thanks!
--
from
Dave the wave~~~~~

"Bob Phillips" wrote in message
...

iRows=Selection.Rows.Count
iColumns = Selection.Columns.Count

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Dave the wave" wrote in message
...
Is there a means for discovering the size of a particular range? (Like,

how
many rows or columns are in the range.) (Using VBA, of course.)

--
from
Dave the wave~~~~~







Robin Hammond[_2_]

Determining the size of a range.
 
Dave,

Try this

Dim rngTest as range
set rngTest = selection
debug.print rngTest.Count 'number of cells
debug.print rngTest.Columns.Count 'number of columns
debug.print rngTest.Rows.Count 'number of rows

Robin Hammond
www.enhanceddatasystems.com

"Dave the wave" wrote in message
...
Is there a means for discovering the size of a particular range? (Like,

how
many rows or columns are in the range.) (Using VBA, of course.)

--
from
Dave the wave~~~~~






All times are GMT +1. The time now is 02:37 PM.

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