+ Reply to Thread
Results 1 to 4 of 4

Can one include the content of a cell in an "Import Data" file path?

Hybrid View

  1. #1
    Registered User
    Join Date
    11-29-2010
    Location
    Jerusalem, Israel
    MS-Off Ver
    Office 365
    Posts
    7

    Can one include the content of a cell in an "Import Data" file path?

    I have a series of over a hundred text files in a single folder, all of the same format. I have a spreadsheet that uses "Get & Transform Data From Text/CSV" to select one of them and insert its contents into the range of cells A1:C20000.

    Normally you can change which file is loaded by going through Queries & Connections, or various other GUI elements. But I want the user to be able to simply type the desired filename into cell H6, and it will change which file is loaded into A1:C20000.

    Is this possible?

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Can one include the content of a cell in an "Import Data" file path?

    probably not, not unless you do the import with code. maybe check out the QueryTables.Add method?

    https://docs.microsoft.com/en-us/off...uerytables.add

  3. #3
    Registered User
    Join Date
    11-29-2010
    Location
    Jerusalem, Israel
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Can one include the content of a cell in an "Import Data" file path?

    Hmm. As an alternative, do you know how I can batch import all of the text files into new sheets in the workbook, one per sheet based on filename? If so, that makes it easy, because I can just use INDIRECT.

  4. #4
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

+ 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. Replies: 18
    Last Post: 04-11-2019, 02:24 PM
  2. Replies: 1
    Last Post: 10-22-2018, 03:18 PM
  3. How to import IQY file without "Import Data" Dialogue Box?
    By cheeks23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2018, 03:39 AM
  4. Replies: 7
    Last Post: 11-08-2015, 03:57 PM
  5. Hyperlink to any file based on cell content using "Alt+Q" shortcut
    By venablmi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2013, 10:20 AM
  6. Transfert cell values from file "A" to file "B" skipping columns in file "B".
    By Sentrosi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2009, 11:11 PM
  7. [SOLVED] how do i automaticly "save as" using a cell's content as file nam
    By cxlough41 in forum Excel General
    Replies: 5
    Last Post: 01-05-2006, 01:55 AM

Tags for this Thread

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