Determining the size of a range.

D

Dave the wave

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.)
 
B

Bob Phillips

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

Dave the wave

Thanks!
--
from
Dave the wave~~~~~

Bob Phillips said:
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)
 
R

Robin Hammond

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
 
Top