+ Reply to Thread
Results 1 to 9 of 9

Query connection referring to a cell value

  1. #1
    Registered User
    Join Date
    08-17-2010
    Location
    Oxford
    MS-Off Ver
    Excel 2010
    Posts
    27

    Query connection referring to a cell value

    Hello all,

    I am in my first forrays in working with excel queries and would like some advice. See attached spreadsheet for reference.

    I have recorded the queries code. This essentially inputs a range of data from a text file into excel. At the moment this is a specified text file (Metrics-GP22012BahrainR1Trummer.txt) which means that the same data is input every time the macro is run. So the current code looks like this:

    Please Login or Register  to view this content.
    I would like the file path to refer to a cell ($C$10) so as different .txt files are called up in the query depending on the selections made in the table ($C$3:$C$8). I suppose the code would be something like this:

    Please Login or Register  to view this content.
    This might not even be possible so simply but any advice anyone could give would be appreciated.

    Thanks,

    RanaldMetrics_Compare_03.xlsm
    Attached Images Attached Images

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Query connection referring to a cell value

    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    07-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    44

    Re: Query connection referring to a cell value

    I am trying to do the same thing but with a web query and I can either have URL;http://star.finra.org/STAR/Main.aspx?source=starapp&MatterID=20110275622&action=mattersearch" in a cell or just Main.aspx?source=starapp&MatterID=20110275622&action=mattersearch. can I reference the cell as a variable so I can loop through the data?


    Please Login or Register  to view this content.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Query connection referring to a cell value

    Please start your own question rather than hijack someone else's.

  5. #5
    Registered User
    Join Date
    07-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    44

    Re: Query connection referring to a cell value

    I didn't mean to hijack anything, I thought you solved his question already and it is really similar to mine. I thought they do not want you to start your own question if it is basically the same as someone elses. I am new hear so I am learning the proper etiquette

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Query connection referring to a cell value

    Quite the opposite, I'm afraid. See forum rule #2. You can add a link back to this question.

  7. #7
    Registered User
    Join Date
    07-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    44

    Re: Query connection referring to a cell value

    oh okay thanks for the headsup! sorry for the mistake

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Query connection referring to a cell value

    No problem - makes no odds to me, but we'd both get in trouble with the moderators if we'd carried on here.

  9. #9
    Registered User
    Join Date
    08-17-2010
    Location
    Oxford
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Query connection referring to a cell value

    Hi Romperstomper,

    Thank you for your help. That has solved the problem nicely.

    It's simple when you know how!
    Last edited by ranald; 06-14-2012 at 04:53 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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