RE: $$Excel-Macros$$ finding the last row

2010-10-31 Thread Dave Bonallack
? Regards - Dave Date: Sun, 31 Oct 2010 09:08:38 +0530 Subject: Re: $$Excel-Macros$$ finding the last row From: neil.jh...@googlemail.com To: excel-macros@googlegroups.com Hi, To Find the last non empty row try this syntax : dim lastrow lastrow = cells(rows.count,1).end(xlup).offset(1,0).row

Re: $$Excel-Macros$$ finding the last row

2010-10-31 Thread neil johnson
Hi, To Find the last non empty row try this syntax : dim lastrow lastrow = cells(rows.count,1).end(xlup).offset(1,0).row msgbox(lastrow) Or you can use Dim lastrow lastrow = Cells(Rows.Count, 1).End(xlUp).Row + 1 MsgBox (lastrow) step 2 ( if you want to color to last row) cells(lastrow,1).int

Re: $$Excel-Macros$$ finding the last row

2010-10-30 Thread Maries
Hi Lakshitha, *Use the following code:* ** Sub FindLastRow() Dim LastRow As Long If WorksheetFunction.CountA(Cells) > 0 Then 'Search for any entry, by searching backwards by Rows. LastRow = Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).R