+ Reply to Thread
Results 1 to 5 of 5

Copy data from another file

  1. #1
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Indonesia
    MS-Off Ver
    2010
    Posts
    177

    Copy data from another file

    Hello,

    I am practising to copy data from another sheet (example: B.xlsx) then paste the data to current sheet (A.xlsm), do calculation,
    the copy back the result to B.xlsx
    below is code using macro recorder:
    Please Login or Register  to view this content.
    example file attached.

    my questions:
    - how to modify the code, with the condition, B.xlsx is not open yet.
    - how to do same process for each cell in column A until last cell.
    - how to save as A.xlsx with date addition.

    Appreciate for any help.
    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Copy data from another file

    5B:
    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Indonesia
    MS-Off Ver
    2010
    Posts
    177

    Re: Copy data from another file

    Hi Karedog

    Thank you for your help. The code works great!

    so if i need to have the strFile="B.xlsx" became dynamic, so we can select the file using dialog box.

    what to modify from code below?

    Please Login or Register  to view this content.

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Copy data from another file

    Like this ?
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Indonesia
    MS-Off Ver
    2010
    Posts
    177

    Re: Copy data from another file

    Hi,

    Sorry for late reply.

    The code works great! Thank you very much.
    Last edited by qiyusi; 04-19-2017 at 01:49 AM. Reason: problem solved

+ 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. [SOLVED] Copy the data from Master file and paste into individual excel file as per criteria
    By Vikas_k in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-30-2023, 09:15 AM
  2. Replies: 1
    Last Post: 07-11-2015, 01:04 AM
  3. Require help in modifying the code to copy data to an existing file instead of new file
    By ahamedcader in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2014, 02:57 PM
  4. Want to open file, copy filtered data to new workbook and at save as new file
    By satishdu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-25-2014, 12:39 PM
  5. [SOLVED] open variably named file, copy/paste data into consolidation file, open next file in list
    By sllawrence1968 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2012, 09:49 PM
  6. [SOLVED] Macro to copy file names and data from each file in a folder into master spreadsheet
    By dee1989 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-10-2012, 05:52 AM
  7. Copy data from new everyday csv file to next empty row in master excel file
    By hablu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-18-2009, 02:06 AM

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