+ Reply to Thread
Results 1 to 5 of 5

Getting value in a file from a file whose name is in a cell

  1. #1
    Registered User
    Join Date
    01-31-2022
    Location
    Chicago
    MS-Off Ver
    Excel 365?
    Posts
    3

    Getting value in a file from a file whose name is in a cell

    I want to do a code in Excel because I’m new to VB. I am trying to have the code search for a value in a (unopened) file but the file name I want to have it search is in a cell…

    Example:
    A B
    1 CODE TOTAL
    2 1234 (Need Output/Code here for file name that is in A2)
    3 5678
    4 9012


    I want the code to search in a folder (say C:\Projects\Quantities) and look at any .xlsx file that has that name shown in the corresponding column A cell (Example: 1234.xlsx). I want it then to output the cell that’s in $F$26 (value would be from 0 to 100,000) in 1234.xlsx. I tried maybe putting ‘A2’ into the cell code but it’s just looking for the text rather the cell.

    The thing is that Column A will change depending how many files are in said “C:\Projects\Quantities” folder. (Able to get that from Data==>Get Data. Currently trying to write my first Macro for that).

    Any help or guidance about this issue would be helpful and most appreciative.

  2. #2
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Getting value in a file from a file whose name is in a cell

    Try to run this one

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-31-2022
    Location
    Chicago
    MS-Off Ver
    Excel 365?
    Posts
    3

    Re: Getting value in a file from a file whose name is in a cell

    Thank you. I'm going to try to learn how to do VB (Visual Basic) so when I do, I will try to use this (I presume that this is VB). Would you have any idea how to convert this for a single cell code in Excel?

  4. #4
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Getting value in a file from a file whose name is in a cell

    This is based on a single cell and yes this is VBA

    Please Login or Register  to view this content.
    Last edited by JEC.; 01-31-2022 at 05:06 PM.

  5. #5
    Registered User
    Join Date
    01-31-2022
    Location
    Chicago
    MS-Off Ver
    Excel 365?
    Posts
    3

    Re: Getting value in a file from a file whose name is in a cell

    That was very helpful. I have to adjust the code a little bit but I will get it working. Thank you.

+ 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: 5
    Last Post: 12-23-2022, 04:02 AM
  2. [SOLVED] Importing a text file by vba referring to a cell for file name & file path
    By Vivek2705 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 12-01-2017, 08:54 AM
  3. [SOLVED] Loop through files in folder, email file to listed recipient of file name = cell value
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2017, 03:41 PM
  4. [SOLVED] Compare cell in one file to same cell in another file, continue macro only if cells match
    By CherylC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2014, 09:31 PM
  5. Open 2nd file(CSV) from cell reference, copy columns to main file & close 2nd file
    By Langchop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2013, 05:09 AM
  6. Replies: 1
    Last Post: 07-14-2007, 07:25 AM
  7. Copying of cell text from one file to paste as cell comments in a 2nd file
    By Wayne in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-02-2005, 02:06 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