+ Reply to Thread
Results 1 to 3 of 3

how to insert file path of every file in a folder as a string?

  1. #1
    Registered User
    Join Date
    05-31-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    2

    Unhappy how to insert file path of every file in a folder as a string?

    Hello everyone, I've got a small problem and I can't figure out how to fix it (especially because I normally don't ever use Excel), but let me explain my problem first:
    In the cells A1 and B2 I saved the names of two variables, cells A2-A50 is filled with consecutive numbers (#1, #2, etc.).
    These numbers represent the number of a picture in a certain folder on my PC, and now I have to put the file-paths of the pictures in the cells B1-B50.
    Fifty is just an example, the whole thing is supposed to hold as many pictures as needed (in some cases that could be over one thousand pictures) - individual pasting of the values is a no go here.
    My first idea was to change the name of the images via the rename-function of windows, so that the pictures now have the file-path "C:\folder\picture(1)" - "C:\folder\picture(50)".
    I pasted the path in the first three cells of a column and hoped that Excel would recognize the pattern, but it didn't.
    My second idea was to use something like Length, Replace and CharAt or something like that, but like I said, I have never used Excel. Another idea was to use a variable in between the brackets, but I don't know how to do that (the file may not get additional columns and the first column has to keep the '#' in front of the numbers).
    Also I need to save the whole file as a .csv and the file-paths are supposed to be a STRING-type in the end.

    I'm completely out of ideas, I googled for a while, but it looks like no one had a problem like that before, or maybe they had, but I'm searching for the wrong things.

    Can someone help me? I would really appreciate it
    Last edited by Gamekiller48; 05-31-2013 at 02:12 PM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,078

    Re: how to insert file path of every file in a folder as a string?

    Try

    in A1
    ="C:\folder\picture("&ROW()&")"
    copy down the column

    If you start at a different row you'll have to adjust the ROW() with ROW()-1 or ROW()-2 depending what row you start at
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    05-31-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: how to insert file path of every file in a folder as a string?

    First of all, thanks for the answer, but sadly this doesn't work - all of the cells only show #Name? (I added this in A1, though I actually would have to start in A2, because A1 needs to be filled with a variable-name).

    Edit: Nevermind, I found the answer: I use a German version of Excel, and it won't accept English commands for some reason -_-
    Last edited by Gamekiller48; 05-31-2013 at 02:11 PM.

+ 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