Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default find range size

so i have a range named Range("DRP")
that range is always changing, and i would like to know how many cells
wide and long it is..
for example....if currenty Range DRP is from A1:D5, i want to know that
it spans 5 columns and 4 rows.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 266
Default find range size

"Nigel" skrev i en meddelelse
ups.com...
so i have a range named Range("DRP")
that range is always changing, and i would like to know how many cells
wide and long it is..
for example....if currenty Range DRP is from A1:D5, i want to know that
it spans 5 columns and 4 rows.


Nigel

Number of columns:
Range("DRP").Columns.Count

Nuber of rows:
Range("DRP").Rows.Count

--
Best regards
Leo Heuser

Followup to newsgroup only please.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default find range size

Hi
Range("DRP").Rows.Count
Range("DRP").Columns.Count

If you give the range a name and declare it as a range variable
Dim myRange as Range
Set myRange = Range("DRP")

then you will get the drop down menus for the range objects properties
and methods as you type.
regards
Paul

Nigel wrote:

so i have a range named Range("DRP")
that range is always changing, and i would like to know how many cells
wide and long it is..
for example....if currenty Range DRP is from A1:D5, i want to know that
it spans 5 columns and 4 rows.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default find range size

A named range is just a string that represents the range. So:

Sub rover()
MsgBox (Range("Nigel").Count)
MsgBox (Range("Nigel").Address)
MsgBox (Range("Nigel").Rows.Count)
MsgBox (Range("Nigel").Columns.Count)
End Sub

Will tell you how many cells are in the range, it over-all dimensions and
the number of rows and columns.

Have a pleasant day!
--
Gary's Student


"Nigel" wrote:

so i have a range named Range("DRP")
that range is always changing, and i would like to know how many cells
wide and long it is..
for example....if currenty Range DRP is from A1:D5, i want to know that
it spans 5 columns and 4 rows.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default find range size

Nigel

Try this one


Sub Macro1()
For Each Column In ActiveSheet.Range("DRP").Columns
x = x + 1
Next
For Each Row In ActiveSheet.Range("DRP").Rows
y = y + 1
Next
MsgBox "There are " & x & " Columns and " & y & " Rows"
End Sub

Regards

Piet

Nigel schreef:

so i have a range named Range("DRP")
that range is always changing, and i would like to know how many cells
wide and long it is..
for example....if currenty Range DRP is from A1:D5, i want to know that
it spans 5 columns and 4 rows.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default find range size

=ROWS(DRP)
=COLUMNS(DRP)

Regards,
Stefi

€žNigel€ť ezt Ă*rta:

so i have a range named Range("DRP")
that range is always changing, and i would like to know how many cells
wide and long it is..
for example....if currenty Range DRP is from A1:D5, i want to know that
it spans 5 columns and 4 rows.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace size Neil Excel Discussion (Misc queries) 2 February 23rd 08 08:12 PM
Find Folder Size vqthomf Excel Programming 10 September 11th 06 01:26 PM
How to find avg for step size? Omkar Excel Worksheet Functions 7 June 17th 06 04:01 PM
Cannot Expand Named Range - when size of the Range exceeds Snig Excel Discussion (Misc queries) 1 July 7th 05 01:46 PM
How to find out the size of a variable-size array ? Adrian[_7_] Excel Programming 1 July 6th 04 09:12 AM


All times are GMT +1. The time now is 07:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"