Find last row without counting the first one in the sheet

Adi21

Board Regular
Joined
Aug 11, 2014
Messages
62
Hi, I want to find the last row in a sheet, but without counting the first one.
The first row is the top of the tabel and it`s posibile that I don`t have dates, but the first row is there and after that I have to copy the dates from that file to another and is copied the first row when the other rows are empty.
It`s posible to modify this code:
Code:
LR = Sheets("Faza2").Cells.Find("*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
to run only from the end to row2(if there is only first row).
Thanks
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Surely the last row in the sheet will always include the first row? If row 10 is the last row, and you tell it to ignore the first row then the last row will still be row 10?

So.... if LR = 1 and you want to ignore it then just set it to 2, otherwise leave it as it is.
Code:
    LR = Sheets("Sheet1").Cells.Find("*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
If LR = 1 Then LR = 2
 
Upvote 0

Forum statistics

Threads
1,214,927
Messages
6,122,309
Members
449,080
Latest member
jmsotelo

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