+ Reply to Thread
Results 1 to 12 of 12

Connect Excel cell to Database Table cell

  1. #1
    Forum Contributor
    Join Date
    01-31-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    124

    Connect Excel cell to Database Table cell

    working on excel file , wants to connect excel cell to database table cell, I have already created report the MS query , wants to pulls the data in excel cell from database table

    for example in excel file in cell there is Item # 10006111 wants to pull Price from database table for this cell only, when I connect to this cell the report I created it, some how it brings all the fields from the report on the excel file, I just want to show the price only, is this can be done, and wants to add with parameter range also, this report I have created is with parameter, parameter can add only I item # one time not a range,

    does any one have any idea, if this is possible,

    I will be really greatful for the help.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Connect Excel cell to Database Table cell

    Sorry, Im afraid I 1-don't understand what exactly you're asking, 2-would need a sample worksheet with current code if possible.. If you simply want to look up the price for an item from a table, you probably don't need queries, and can use a macro to simply get the price and put the value in the cell you require.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor
    Join Date
    01-31-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Connect Excel cell to Database Table cell

    thanks for quick reply, see attached the sample report, excel file and MS query

    in excel file I have some Item# and below MS query report created from database, wants to pull price for this item 10006111 $ 10500.00 in E3 , is there a way to connect these both, if I enter the item in MS query the price can show in excel file, you mention some thing about macro, this report some user will be using it, trying to make it easy way, any suggestion will be welcome.

    and right now when I enter item # its not pulling price in E3, I don't know what else I can do
    Attached Files Attached Files

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Connect Excel cell to Database Table cell

    Ok so how are you getting the query to run from excel? How do you tell the query what Part number? will you want the macro to get you the one result? or work through the list? the code below should work for a single item, and can be adapted to work down the whole list of item#'s. I can't test as it would mean having to make a database with relevant fields.... try it and let me know.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-31-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Connect Excel cell to Database Table cell

    thanks for reply, we use the different excel spreadsheet every day with different item # than we have to add macro to each excel file correct ? please confirm , since this spreadsheet other user will be using it, so trying to figure it out to make it easy for them, if they enter item # cell can pull amount from database table cell,

    right now I have parameter in MS query and I enter item and tell to return data to Microsoft excel and and which cell, it pull all the fields, I just want to connect to amount field,
    right now using ODBC connection, is there any other connection can work to accomplish what I am looking for, any help will be great,
    Attached Files Attached Files

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Connect Excel cell to Database Table cell

    I don't know what your ms query looks like? usually in a query in Access you can specify which fields to display (checkbox) do you have that option? If your query only returns ONE parameter then that should be all that comes down? I can't actually see much of your query and am new to this, but I suggest you review what columns are included in your query, sounds like you have the whole table instead of limiting it to what you need.

    That being said, yes with my macro you would need it on each excel file. Why do they need a new file each day? I don't know enough about your process to know what solution to suggest.
    Last edited by Arkadi; 02-20-2014 at 11:53 AM.

  7. #7
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Connect Excel cell to Database Table cell

    Which connection in your attachment is the one for the price query?

    Does the attached file do any better? I modified a small part of Pricedisctable-1
    Attached Files Attached Files
    Last edited by Arkadi; 02-20-2014 at 12:11 PM.

  8. #8
    Forum Contributor
    Join Date
    01-31-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Connect Excel cell to Database Table cell

    I am not sure if connection is working properly or not. why I can't just connect single cell data from MS query,
    I have searched so much on internet, can you tell may me I am missing some link, am I suppose to enter any info on excel cell E3 that wil connect to MS query table cell amount ,
    we create new pricing quote for customer, they are on new excel file that's why macro will
    not work for us. if there is any other connection or any other way I can automate the
    single cell with MS query pulling amount,

    I will be greatful for any idea.
    Attached Files Attached Files

  9. #9
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Connect Excel cell to Database Table cell

    Bitto.. you didn't like my macro idea because you have a new excel file each day? But would that not be the same problem if you have to set up a new excel sheet with MSQuery?

  10. #10
    Forum Contributor
    Join Date
    01-31-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Connect Excel cell to Database Table cell

    with MS query, we will just have to do connect, since query is already there, don't know if its going to work, I would like to give it a try, macro idea is good, because first I have \
    not used macro before, even if I add the macro you send it to me , we have to add in every
    excel file,

    I really appreciate all your help,

    can some one else suggest any idea, if they have done this or how can I achieve this.
    thanks again

  11. #11
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Connect Excel cell to Database Table cell

    Bitto Im pretty sure when you set up the connection, and you pick a database, then you pick a table correct?
    When you choose a table, the next part has all the fields listed in a window.... you need to remove all the extra fields, select field you don't want, and click REMOVE.... only keep on the list what you need. Then you will not get the extra fields that you don't want.

  12. #12
    Forum Contributor
    Join Date
    01-31-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Connect Excel cell to Database Table cell

    I am trying to connect to MS query through ODBC connection, some how its not working, can you please help me with this below are
    steps I am using Data > From other Sources > From Microsoft Query>
    Database Queries Olap Database
    1 New Data Source
    2 Ax Live
    3 dbase Files
    4 Excel Files
    5 Ms Access Database

    which steps I should take it, so its connect to MS query through ODBC connection,

    thanks again for your help,

+ 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. How to connect Excel Vba to mysql database
    By sudhakar reddy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-24-2012, 05:50 AM
  2. excel template connect to access database???
    By ddaudi8 in forum Excel General
    Replies: 1
    Last Post: 04-16-2009, 03:40 PM
  3. connect excel to access database
    By associates in forum Excel General
    Replies: 13
    Last Post: 11-13-2007, 06:34 PM
  4. [SOLVED] can data be sent from a cell in excel to a database table?
    By mtarkington in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-17-2006, 12:00 PM
  5. [SOLVED] connect a form to excel database
    By Kathy in forum Excel General
    Replies: 5
    Last Post: 10-10-2005, 02:05 AM

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