Jump to content

Recommended Posts

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
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
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

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
×
×
  • Create New...