LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Find last row with data in set range

Hi,

I have this code:

Sub LastRow()

Dim a As Integer

For a = 12 To 100
''' If Range("A" & a) = "" Then
''' LastR = a - 1
''' Exit For

''' Else
If Left(Range("A" & a), 5) = "Total" Then
LastR = a - 1
Exit For
Else

End If
Next a

End Sub

at the moment this code finds the last row, what I would like the code
to do as well if there are empty rows above "Total" then minus them
until the code finds the row with data in it.

Thanks
 
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
how find max data in range in excel how findout max data like text, any word[_2_] Excel Discussion (Misc queries) 6 January 17th 09 01:55 PM
Find a Range of Data John Sutton Excel Discussion (Misc queries) 4 September 11th 06 05:42 PM
Find last used row in Range with Data above and below. Casey[_52_] Excel Programming 5 February 28th 06 11:02 PM
Help, how to find a range of data? jub366 Excel Worksheet Functions 3 October 11th 05 01:20 AM
find first data entry in range joho Excel Programming 1 September 6th 05 01:02 PM


All times are GMT +1. The time now is 03:01 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"