importing data excel access
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

resolvedResolved · Low Priority · Version 2007

replyReply Wed 11 May 2011, 15:04Delegate James said...

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

For upcoming training course dates see: Pricing & availability

replyReply Thu 12 May 2011, 16:07Trainer Simon said...

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

replyReply Wed 18 May 2011, 10:43Trainer Simon said...

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.

 

Please browse our web site to find out more about
ms access training and other Microsoft training courses.

Access tip:

Hide Access Tables

One method of stopping your Access tables appearing in Database window, is to rename the table(s) with the prefix usys.

This converts the table into a system object, which cannot be viewed in the Database window.

You can show system objects in the Database window by the following:

Step 1: On the Tools menu, click Options.
Step 2: Click the View tab.
Under Show, select the System Objects check box.
Click OK.

View all Access hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard