+ Reply to Thread
Results 1 to 9 of 9

Copy every opened workbook data to Main File

  1. #1
    Forum Contributor
    Join Date
    12-18-2019
    Location
    chennai
    MS-Off Ver
    excel 2010
    Posts
    141

    Post Copy every opened workbook data to Main File

    Hi

    Seeking some one help to create VBA code for this.

    Workbook A. This is my main file, this is saved in Path C:\test folder\Workbook A.Xls

    First i will open this file,

    then i will open another excel files example- workbook B. (This is one sample, name of the workbook is not fixed one)


    Macro to start from here.

    In workbook A, Active sheet to be cleared (if data already exists)
    In workbook A, Active sheet objects to be deleted.
    Now active worksheet of Workbook A is empty data.

    Now i want to copy, active worksheet of another opened workbook (file name, sheet name whatever it may be) Example Workbook B

    and paste in active worksheet of workbook A


    Sample files attached
    Last edited by ayyappan80; 10-25-2020 at 08:02 AM.

  2. #2
    Forum Contributor
    Join Date
    08-12-2020
    Location
    Atlanta, Georgia
    MS-Off Ver
    Office 16
    Posts
    241

    Re: Copy every opened workbook data to Main File

    There are no sample files attached.

  3. #3
    Forum Contributor
    Join Date
    12-18-2019
    Location
    chennai
    MS-Off Ver
    excel 2010
    Posts
    141

    Re: Copy every opened workbook data to Main File

    apologies sample file added now
    Attached Files Attached Files
    Last edited by ayyappan80; 10-18-2020 at 12:43 AM.

  4. #4
    Forum Contributor
    Join Date
    12-18-2019
    Location
    chennai
    MS-Off Ver
    excel 2010
    Posts
    141

    Re: Copy every opened workbook data to Main File

    Anyone please help

  5. #5
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Copy every opened workbook data to Main File

    Place this in your main doc and give it a try. Make sure to backup your data ahead of time

    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Copy every opened workbook data to Main File

    Try
    Main workbook & other workbook are open before run this code as per your detailed explanation.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-18-2019
    Location
    chennai
    MS-Off Ver
    excel 2010
    Posts
    141

    Re: Copy every opened workbook data to Main File

    Hi Jindon.

    thanks, your code is working as expected.

  8. #8
    Forum Contributor
    Join Date
    12-18-2019
    Location
    chennai
    MS-Off Ver
    excel 2010
    Posts
    141

    Re: Copy every opened workbook data to Main File

    Hi Manicab

    I have tested your code also its working fine, only one issue its asking to open the workbook B. but requirement is to copy from already opened workbooks.

    Thanks for your help

  9. #9
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Copy every opened workbook data to Main File

    I purposely use the open function to identify the second workbook in the code. I am glad you have a working solution.

+ 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] Run through list with file locations copy data back to main workbook
    By jatki19 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2020, 03:21 AM
  2. Search multiple headings in other sheet, copy data and paste in main file
    By Zahid0111 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2020, 10:09 AM
  3. [SOLVED] Copy range from workbook opened with a file picker
    By potga in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-30-2016, 09:33 AM
  4. Automatically Copy Data from Workbook - Main Workbook
    By BigBobBobson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-13-2015, 06:59 AM
  5. Copy data from the workbook which opened by other user
    By intex in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2014, 08:13 PM
  6. [SOLVED] VBA to copy data from one workbook to another main workbook
    By hate0lif3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2014, 02:52 AM
  7. Use a macro to extract cell data from opened workbook to new opened workbook
    By BrianTFC in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-26-2014, 01:35 PM

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