Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Identify last row containing data

Two points on your Find statement. First, (and this may just be
misinterpreting what you mean by "any content") because you specified
xlValues, cells with formulas that return the empty string will be ignored
by your Find statement, even if that formula is in a lower row than a
non-empty cell). Second, since the search is progressing backwards (due to
the xlPrevious argument), specifying the first cell in the range will
accomplish the same thing as specifying a cell in the last row of the
worksheet within the range. So, instead of RR.Cells(RR.Cells.Count), I would
use RR(1) instead.

--
Rick (MVP - Excel)



"Chip Pearson" wrote in message
...

Try code like

Dim RR As Range
Dim R As Range
Set RR = Worksheets(1).Range("H:T")
Set R = RR.Find("*", RR.Cells(RR.Cells.Count), _
xlValues, xlWhole, xlByRows, xlPrevious, False)
Debug.Print R.Address

This searches for any content at all in columns H to T, working
backwards sot he first cell found is the last used cell.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com




On Wed, 24 Mar 2010 14:10:38 -0700 (PDT), MJKelly
wrote:

Hi,

How can I identify the last row containing data on a sheet where the
last entry could appear in any column from H to T? I can only think
of looping through the columns and comparing the lastrow number of
each and then identifying the highest value? Surely there is an
easier way?

Thanks,
Matt


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
De-identify data Eilean Excel Worksheet Functions 2 May 21st 08 02:22 AM
Identify last row of populated data Jumbo Shrimps, Jr. Excel Worksheet Functions 2 April 8th 07 08:03 AM
identify duplicate data upon entry of that data Jan Buckley Excel Discussion (Misc queries) 5 December 21st 06 10:11 PM
identify different data in two columns fitzy Excel Discussion (Misc queries) 2 July 20th 05 11:13 AM
Compare and identify new data Dave Baffled Excel Programming 2 November 25th 03 06:14 PM


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