+ Reply to Thread
Results 1 to 3 of 3

Running an Access Macro from Excel

  1. #1
    Registered User
    Join Date
    04-18-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    49

    Running an Access Macro from Excel

    Hi guys!

    I know it’s pretty easy to run a standard Access query/ macro from Excel. But what if I want an Access query to filter on a value from Excel cell (s)? For example I want to be able to list Customer Names in Excel Range (“A1”).Cells and have it run Access Macro so “Customer” field in Access queries filter on Excel Range (“A1”).Cells values? Is this possible? If it is, can wild characters like * be used?
    I am posting this in Excel part of the forum because I am hoping to come up with a Code from Excel side, but if it easier to start it from the Access side, where Access finds Excel file and gets the values from there, I would very appreciate help too.

    Thanks a lot for any advice!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Running an Access Macro from Excel

    Hi,

    Do you have the Excel File LINKED into Access as a Table? If you did, then you could use any of the data in the Excel table from Access.

    At the some time, I don't think Access can tell what the ActiveCell is or any of those moving around things. Excel data will simply be a table for Access. You can use all those "Like" query operators in Access.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    04-18-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Running an Access Macro from Excel

    Hi Marvin,
    My ultimate goal is to create a code that would run multiple reports.
    For example I listed Customers ABC, DEF, GHI in Range (“A1:A3”), and Customers BAC, FED, HIG in Range (“B1:B3”), I want an Access Macro ran for those listed in (“A1:A3”), then the output damped into Excel, Excel macros would kick in and do the formatting, file saved and then the same thing repeated for those listed in (“B1:B3”), and so on… I’ve learned a little of VBA (with a huge help of this forum), so I am capable of handling transferring the data from Access to Excel to a template, creating and activating formatting /save as Excel Macros, I am having hard time with figuring out how to approach this problem conceptually.
    If I link the table as you advised, should I then write a macro that updates the linked table with the new data from “the data input file” and refreshes the link for each separate set of customers I need to run? Would that be a decent approach? What if I need multiple filtered fields (Let’s say “Customers” and “Ship to States”), will that approach handle multiple tables?
    Once again, thanks for your time!

+ 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. Setting "Current" access database and running macro from Excel
    By beat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-10-2013, 12:07 PM
  2. Opening Excel from Access, running Code in Excel then export back to Access
    By JungleJme in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-28-2012, 08:49 AM
  3. Running an Access macro via Excel on a shared Access db
    By koltregaskes in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-07-2011, 10:22 AM
  4. Automatically saving access query as Excel file and then running a macro
    By Spac3Monkey1 in forum Access Programming / VBA / Macros
    Replies: 0
    Last Post: 06-10-2009, 09:54 AM
  5. Running an Excel macro from Access problem
    By Huff in forum Excel General
    Replies: 3
    Last Post: 07-11-2006, 01:40 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