+ Reply to Thread
Results 1 to 11 of 11

Read in data from one file to another

  1. #1
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Read in data from one file to another

    my Name is Sebastian. I'm from Germany.
    I have to tell my problem here, because the german side is currently down

    my Problem:
    I have 2 Excel files. One with the macro-code and another one.
    The one with the macro is named "Book1.xlsx" and the other one is named "Book2.xlsx".
    The name of the second file (in this case Book2) change weekly. But the name of the sheet in which are my data is always the same (in this case "sheet1").

    For my understanding:
    - I start the macro in Book1.
    - The macro ask me for the other file with the data i need
    - I open the file (Book2 in this case)
    - Now the macro should read out data from Book2(table) an put it into Book1 (table)
    - After read out a area with no entry --> read out should finish or after 16 columns.
    - After read out the files from the table the macro should close the Book2.


    This is my file, can anyone take a look at this?
    [I]
    Please Login or Register  to view this content.
    one more question, can i declare two variables? like i & j ?
    Like: i is from 4 to 16 and j is from 6 to 18 ? or should i write "i+2" instead of j ?

    sorry for my bad english. I try my best
    Attached Files Attached Files
    Last edited by alansidman; 05-16-2014 at 09:40 AM. Reason: Code tags

  2. #2
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Read in data from one file to another

    If i only use the same file instead of "fileselection" it works. But as mentioned before, this filename changes every week

    Please Login or Register  to view this content.
    So i need the first part of the code for the fileselection
    Last edited by alansidman; 05-16-2014 at 09:40 AM.

  3. #3
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Read in data from one file to another

    no one an idea?

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,687

    Re: Read in data from one file to another

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between
    Please Login or Register  to view this content.
    tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)

    Please read all the forum rules. You will find it is ok to "bump" threads, but it is recommended that you wait at least 24 hours before doing so. Many of our members are worldwide and are active on the forum as time and personal needs/work permits. Be patient. We are all volunteers here with other lives.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Read in data from one file to another

    ok, thank you

    is this problem so difficult? or to easy?
    Last edited by bluesurger; 05-16-2014 at 11:03 AM.

  6. #6
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Read in data from one file to another

    hm, what a shame

  7. #7
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Read in data from one file to another

    hm, what a shame
    You're impatience is quite rude.


    You can't have code in a xlsx workbook.

    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  8. #8
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Read in data from one file to another

    sorry, that was not my intention, now I can continue working. Thank you for your help.
    I was not sure if the information is missing or something else, because no previous feedback has come.

  9. #9
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Read in data from one file to another

    hy @ all.

    ok this code is working. thank you.

    but there is one Problem. If i Copy the Data from WB2 to WB1 it only works with numbers.
    If there is a result in the cell which has an referenz to another value (not in this table) it didn't work.

    How is it possible to read out only the value, no other format or reference?
    Thank you

    kind regards Sebastian

  10. #10
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Read in data from one file to another

    ah, i think i have a solution. is this the right one?

    Please Login or Register  to view this content.

  11. #11
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Read in data from one file to another

    Yes, that's correct.

+ 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. Read data from other xls file
    By EugeneP in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-31-2010, 07:12 PM
  2. Read .csv file data
    By kistonce in forum Excel General
    Replies: 2
    Last Post: 05-09-2010, 03:03 AM
  3. How to read data from txt file to an array?
    By arthurcheuk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-24-2008, 04:36 AM
  4. Read Data from file
    By ethyl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-25-2008, 01:35 PM
  5. [SOLVED] Read data from anohter XLS file
    By John Whitehead via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 09-06-2005, 07:05 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