View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_2_] Alan Beban[_2_] is offline
external usenet poster
 
Posts: 783
Default Count number of rows with actually selecting

And if the range is a collection of rows instead of cells, something
like the following will work to count the rows:

Dim rng As Range
Dim wks As Worksheet

Set wks = ActiveSheet
Set rng = wks.Range("B2:C100").Rows

MsgBox rng.Count

Alan Beban

Jim Thomlinson wrote:
Count is the property of a range. so something like this will work

Dim rng As Range
Dim wks As Worksheet

Set wks = ActiveSheet
Set rng = wks.Range("B2:B100")

MsgBox rng.Count

HTH

Jim Thomlinson


"PC" wrote:


I'm using "Selection.Count" to count the number of cells in a range. How
would I do this without actually visibly selecting the range i.e. I don't
want the active cell to change from that selected by the user when they
started my procedure.

thanks

...pc