View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Count the Number of Variable Rows

Dim myRng as range
with worksheets("Wheel")
set myrng = .range("b4", .range("b4").end(xldown))

'I like coming from the bottom of the worksheet and going to the top.
'just in case there are gaps in column B.
set myrng = .range("b4", .cells(.rows.count,"B").end(xlup))
end with




Paul Black wrote:

Hi everyone,

How can I count the number of rows with data in from "B4" down to
whatever. I would like it based on this please :-

Worksheets("A").Range("B4")

I have tried :-

Worksheets("Wheel").Range("B4").UsedRange.Rows.Cou nt
Worksheets("Wheel").Range("B4","B4" & .End(xlDown), Rows.Count)
Worksheets("Wheel").Range("B4","B" & .End(xlDown), Rows.Count)
Worksheets("Wheel").Range("B4:B" & .End(xlDown), Rows.Count)
etc

Thanks in Advance.
All the Best.
Paul


--

Dave Peterson