James has attended:
Access Advanced course
Access VBA course
Importing data from excel to access using automation within acce
Within access vba I can open a new excel session and browse and open an excel file. I then can go to cell "a1". My problem is going from there. I want to do the excel command .end(xldown), I then want to record what row the last row of data is on.
I have tried an alternative to the above which was:
lrow = Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
but this does not seem to work
RE: Importing data from excel to access using automation within
Hi James,
Thank you for your question and welcome to the forum.
This small bit of code will highlight the last row in your table that contains data:
Sub FindLastRow()
Dim intRow As Integer
intRow = Range("A1").CurrentRegion.Rows.Count
Rows(intRow).Select
I hope this answers your question.
Regards
Simon
End Sub
Will be marked as resolved in 5 days
Notice: This is an automated message. Due to inactivity, this forum post will be marked as 'resolved' if there are no further responses in the next 5 days.