View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Glenn Ray[_3_] Glenn Ray[_3_] is offline
external usenet poster
 
Posts: 34
Default finding last line in macro

Not trying to be slow; just trying to show one way of getting the row.

Here's less code by 17 characters:
r = Range("B65536").End(xlUp).Row


"keepITcool" wrote:

Glenn,
WHY the selects? Is there a need to write slow code on purpose.?
r= Activesheet.Cells(rows.count,2).end(xlup).row


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Glenn Ray wrote :

Insert the following near the beging of your code:

Range("B65536").Select
Selection.End(xlUp).Select

If you want the row number:
r = ActiveCell.Row

"GJR3599" wrote:

How do I code a macro (or keystroke it) to find the last row that
has data in a column without harcoding the macro to a specific row?
I have sections of data (every 6th row is blank) and I want to be
able to find the absolute last row that has data in it for column B
no matter where that last row is. Thanx.