+ Reply to Thread
Results 1 to 8 of 8

Possible to read a specific cell from many excel files automatically?

  1. #1
    Registered User
    Join Date
    03-11-2014
    Location
    Barbados
    MS-Off Ver
    Excel 2003
    Posts
    18

    Question Possible to read a specific cell from many excel files automatically?

    Hello everybody

    Is there anyway to read a specific cell from many excel files automatically and add them to a new workbook?

    I tried to link that specific cell to a new workbook manually but now I have a problem:
    If I change the name of any workbook that is linked to the new workbook, Excel can't update the new file name

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Possible to read a specific cell from many excel files automatically?

    Yes, it's possible to do without linking, using VBA. There are a few questions first:
    1. Are the Excel files already open or are they closed?
    2. Is there a specific Sheet Name?
    3. If the files are closed, is there a list of files, or is there a unique way to identify the files (such as ABC01.xls, ABC02.xls, etc.)?
    4. Where in the new workbook do the copied cells go?

    Lewis

  3. #3
    Registered User
    Join Date
    03-11-2014
    Location
    Barbados
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Possible to read a specific cell from many excel files automatically?

    Thanks for reply

    1. Closed
    2. A few yes but not that important, specific name would be better though
    3. No, each file has a different filename
    4. Company name: 'A' column and Price: 'B' column
    I want it to read the 'C4' (Company name) and 'D4' (Price) of the each excel files.
    Last edited by RiP2; 03-16-2014 at 06:47 PM.

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Possible to read a specific cell from many excel files automatically?

    Hi,

    Try the attached file. It is a first attempt to do what you want. Please let me know what changes you need.

    When you test the file make sure you:
    a. Purposely test a file that has no data in C4 and/or D4
    b. Purposely test a file that doesn't exist.
    c. Purposely test a file that is already open.

    Assumptions:
    a. Data is in the first sheet of the data file.
    b. Company name is in Cell 'C4' and price is in Cell 'D4'.
    c. File Names in sheet 'PriceData' must be contiguous. Use 'None' as a place holder.
    d. File type is .xls, .xlsx. or .xlsm

    Lewis

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Possible to read a specific cell from many excel files automatically?

    If I change the name of any workbook that is linked to the new workbook, Excel can't update the new file name
    If you change the file name while the "new" WB is open, it will update the link autamatically (as long as you then also save the New WB
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Talking Re: Possible to read a specific cell from many excel files automatically?

    Quote Originally Posted by RiP2 View Post
    Is there anyway to read a specific cell from many excel files automatically and add them to a new workbook?
    Sure

    Download the attachment, drop it into the folder containing the workbooks and press the button (after enabling macros)
    Attached Files Attached Files
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  7. #7
    Registered User
    Join Date
    03-11-2014
    Location
    Barbados
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Possible to read a specific cell from many excel files automatically?

    @LJMetzger: Thank you Though your code looks complex, I could write my code finally :D
    @mc84excel: Thank you, will check your code too

  8. #8
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Possible to read a specific cell from many excel files automatically?

    If either of the solutions work, please mark this thread as SOLVED. You will find this as an option in the dropdown in Thread Tools (located in the upper right hand corner).

+ 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: 1
    Last Post: 02-10-2014, 09:13 PM
  2. [SOLVED] Find and read excel files in a specific folder
    By kansalainen in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-05-2013, 06:16 PM
  3. excel files automatically changes to read only
    By Shadmani in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-12-2009, 10:34 PM
  4. Replies: 2
    Last Post: 08-06-2009, 04:43 AM
  5. [SOLVED] Files saved on CD automatically convert to Read-Only; why?
    By PSK from OC in forum Excel General
    Replies: 1
    Last Post: 03-29-2006, 01:55 PM

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