+ Reply to Thread
Results 1 to 5 of 5

Macro to copy Access table into excel

  1. #1
    Registered User
    Join Date
    06-03-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    5

    Macro to copy Access table into excel

    Hi all,

    I was wondering if I could get help with a macro to copy a table into excel.

    I am currently using Office 2010 and the database is an accdb and not mdb.

    My knowledge is not in programming but I lurk on many a code forums putting snippets together of VB to do tasks such as merging multiple tabs on one workbook to opening multiple workbooks and copying tabs into one single workbook or running macros when certain cells are opened/workbooks are opened. So I can get my head around code I'm just not good at writing from scratch.

    Anyway i have become stuck when it comes to pulling a table from access into excel.

    What I want to happen is that when a workbook is opened a macro will run that copies all the data from a specific table in the access database and pastes this into a specific sheet in the active workbook.

    This means that i will always have the latest data in the workbook as things are added to the database through the day without having to go and copy the table myself.

    I have found a few examples of this online but none appear to work and I have exhausted my knowledge to do this

    Unless of course I am missing a much simpler solution?

    Thanks in advance.

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Macro to copy Access table into excel

    you can do this with macro, but I would suggest that you explore the functionality to import data from database (Data tab->Get external data group->From Access). You can set to refresh the query at workbook open
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Registered User
    Join Date
    06-03-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Macro to copy Access table into excel

    Thanks for the swift response. I did try this but the DB is quite large and my excel jammed up.

    The other issue is the db is usually open all the time by other people and when I tried the external access it wasn't allowing me to do it due to it being open.

    I will explore this possibility again, but the reason why I thought about the macro was to avoid any slowness and avoid the access problems.

  4. #4
    Registered User
    Join Date
    06-03-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Macro to copy Access table into excel

    Quote Originally Posted by buran View Post
    you can do this with macro, but I would suggest that you explore the functionality to import data from database (Data tab->Get external data group->From Access). You can set to refresh the query at workbook open
    Thank you. I have just done this and noticed the "read only" option and the table opened immediately in excel and had no other issues.

    Thank you for steering me in the right direction.

  5. #5
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Macro to copy Access table into excel

    Great! By the way, regarding not being able to use the db, because it's open by other people - you should check different options for sharing access db between multiple users. It shouldn't be a problem - just google "access shared db"

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Use an Excel Macro in Access VBA - Import text file in Access Table
    By joogibabu in forum Access Tables & Databases
    Replies: 3
    Last Post: 10-08-2014, 10:04 AM
  2. [SOLVED] Help! Copy named range from excel to access table.
    By Jo2710 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2014, 09:23 PM
  3. Copy data from Access table to Excelsheet using Excel/VBA
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-12-2014, 08:25 AM
  4. Need Access macro to copy data from one table and paste into another.
    By wes675 in forum Access Tables & Databases
    Replies: 2
    Last Post: 01-21-2014, 02:18 PM
  5. Copy table from access to excel
    By hcyeap in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-02-2014, 12:28 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1