Sign in to follow this  
Followers 0
amokoura

[EXCEL] Finding the last row

3 posts in this topic

#1 ·  Posted (edited)

Problem solved.

What's the best solution to find the last empty row of an excel sheet.

I'm trying to add data to the bottom of a sheet but haven't yet found a realiable solution.

I've tried "Range(##).End"-trick but it seems unreliable sometimes.

Could some SQL-thingies come in picture??

Edited by amokoura

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This will work in VBA

Worksheets(<Sheetname>).Cells.Find(What:="*", SearchDirection:=xlPrevious, _ SearchOrder:=xlByRows).Row

This gves the row number. so to use have

Dim RowNum as Integer

RowNum = Worksheets(<Sheetname>).Cells.Find(What:="*", SearchDirection:=xlPrevious, _ SearchOrder:=xlByRows).Row

Edited by phkninja

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks for the Find method! For some reason I didn't get the expected result but I found another solution. The method will come handy in other problems, thx!

Problem solved.

Edited by amokoura

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0