Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

importing data excel access

Forum home » Delegate support and help forum » Microsoft Access Training and help » Importing data from excel to access using automation within acce

Importing data from excel to access using automation within acce

ResolvedVersion 2007

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.

Tue 24 May 2011: Automatically marked as resolved.

 

Training courses

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Access tip:

Combo box for finding records

You can use a combo box in a form to look up a record. If you place the comb box in the Form header, by then selcting they a field type from the drop down loist, you will see the record for it

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.