Find Last Row in Sheet

Gregfox

Board Regular
Joined
Apr 12, 2011
Messages
120
Hi, I’m using Excel 2007, and wish to find the last row in data sheet “Main”, and put text “END” in column A of that last cell. The complication is not all columns always have data.
I’ve tried;
Sub LastRowTest ()
LastRowColA = Range("A65536").End(xlUp).Row<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
ActiveCell.FormulaR1C1 = "text"<o:p></o:p>
End sub<o:p></o:p>
======================================================<o:p></o:p>
And I also tried;<o:p></o:p>
Sub LastRowTest ()
Dim ws As Worksheet<o:p></o:p>
Set ws = Worksheets("Main")<o:p></o:p>
<o:p></o:p>
iRow = ws.Cells(Rows.Count, 1) _<o:p></o:p>
.End(xlUp).Offset(1, 0).Row<o:p></o:p>
'ActiveSheet.Paste 'ActiveSheet.PasteActiveCell.FormulaR1C1 = "text"<o:p></o:p>
End sub<o:p></o:p>
<o:p></o:p>
NO LUCK… Anyone have an answer?
Thanks!
:)
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Tested and working here. If you don't have END in column A then nothing will happen.
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,850
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top