#1   Report Post  
Posted to microsoft.public.excel.misc
UB UB is offline
external usenet poster
 
Posts: 120
Default VBA question

Hi
I have a range defined as Range("C20, L2000"). I want to find the last
record in the range that has any value and then count the number of rows in
this range
Please advise
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default VBA question

Sub countum()
Set r = Range("C20:L2000")
Set terminus = Nothing
For Each rr In r
If IsEmpty(rr) Then
Else
Set terminus = rr
End If
Next
MsgBox (terminus.Row - r.Row + 1)
End Sub
--
Gary''s Student - gsnu200834


"ub" wrote:

Hi
I have a range defined as Range("C20, L2000"). I want to find the last
record in the range that has any value and then count the number of rows in
this range
Please advise

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
where can I see my question and answer? Yesterday I ask a question IP Excel Discussion (Misc queries) 2 May 10th 08 04:08 PM
If, then question Cacoe Excel Worksheet Functions 3 June 30th 06 05:06 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
The question is an excel question that I need to figure out howto do in excel. Terry Excel Worksheet Functions 3 January 23rd 06 06:22 PM
Possible And If Question LS Steakhouse Excel Worksheet Functions 1 March 12th 05 02:45 PM


All times are GMT +1. The time now is 01:39 AM.

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

About Us

"It's about Microsoft Excel"