#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Find last row code

I have the following code to find the last row with data. It works
perfectly. However, how can I make it work on any sheet, essentially the
active tab, as opposed to a specific sheet as in the below example.

Sheets("HI01").Cells(Last(1, ActiveSheet.Cells), "m").Select
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Find last row code

Try this:
Sheets(activesheet.name).Cells(Last(1, ActiveSheet.Cells),
"m").Select


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Find last row code

Thanks Dave. This worked great. Sorry about the multiple postings.
Couldn't see my question.

"Dave O" wrote:

Try this:
Sheets(activesheet.name).Cells(Last(1, ActiveSheet.Cells),
"m").Select



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
How do I find a code in Excel Terranoman Excel Worksheet Functions 4 May 18th 07 02:29 PM
Code using A sheet to find a number Mike Excel Discussion (Misc queries) 6 March 8th 07 07:24 PM
database to Find customer by zip code fjfino Excel Discussion (Misc queries) 0 August 29th 06 09:00 PM
Why code for find() is not working jesmin Excel Discussion (Misc queries) 1 December 28th 05 08:43 PM
Find the cell value in excel by using vb code Michael Excel Discussion (Misc queries) 5 June 14th 05 01:24 PM


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