Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Find and select LastRow Minus 1

Like?

myLastRow = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row-1

"Carlie" wrote:


I am trying to wirte a macro to find and select a range based on the
first and last row (minus one row) of data on a spreadheet

Does anyone know how to incorporate myLastRow with minus 1 row?

Thanks in advance.


Range("A4").Select
myLastRow = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
myLastColumn = Cells.Find("*", [A1], , , xlByColumns,
xlPrevious).Column
myLastCell = Cells(myLastRow, myLastColumn).Address


--
Carlie
------------------------------------------------------------------------
Carlie's Profile: http://www.excelforum.com/member.php...o&userid=33377
View this thread: http://www.excelforum.com/showthread...hreadid=533503


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 to Find the Minus Kilometre Rohinikumar Excel Discussion (Misc queries) 9 March 2nd 10 09:44 AM
CHANGE TRAILING MINUS TO BRACKETS OR PRECEEDING MINUS Socal Analyst looking for help Excel Discussion (Misc queries) 2 May 12th 06 07:17 PM
Chart how to find lastrow? Craigm[_48_] Excel Programming 2 April 6th 06 04:19 PM
How do I find and replace a number with a minus sign in front? D.Sommer Excel Discussion (Misc queries) 1 November 7th 05 10:13 AM
Go to lastrow using other column's lastrow stakar[_14_] Excel Programming 5 April 16th 04 03:42 PM


All times are GMT +1. The time now is 08:58 AM.

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"