+ Reply to Thread
Results 1 to 2 of 2

VBA code to copy multiple worksheets between work books.

  1. #1
    Registered User
    Join Date
    10-19-2012
    Location
    UK
    MS-Off Ver
    Excel 2013/2016
    Posts
    4

    VBA code to copy multiple worksheets between work books.

    Hi,

    I have not clue how to do this and don't have a life time to work it out, so I am happy to pay a reasonable fee to someone who can.

    I want some VBA code I can use on a button press to copy the contents of specific worksheets between two workbooks.

    Main Workbook (MainWB) - .xlsm
    Import Workbook (ImpWB) - .xls / .xlsx

    MainWB has many worksheets. Some are placeholders for data to be imported from the ImpWB. The other worksheets reference the ones to be imported for the data/calculations.
    ImpWB also has many worksheets but not all will be imported. Only data from named worksheets will be copied to the matching worksheets in the MainWB.

    MainWB has button for importing data using VBA code. On Press.

    1) Ask for confirmation (as data will be deleted) - Yes/No pop-up dialog box (with customisable text). Exit on No.
    2) Ask for the ImpWB file name (standard Windows file open dialog box)
    3) Validation check for the existence of all named worksheets in the both Workbooks - if any missing pop-up error with details of missing & the 'OK' to exit.
    4) Delete any existing content/formatting (not the whole worksheet) from the named worksheets in the MainWB. Suppress all prompts.
    5) For each of the named worksheets copy the entire contents (all cols/rows) from the ImpWB to the same named worksheet in the MainWB
    6) For each of the named worksheets in MainDB format as a table (Table Style Medium 16) with first row as headers
    7) Close the ImpWB and DO NOT save any changes.

    Hide the ImpWB whilst the process is happening.

    Add inline code comments to help me understand what section does what.

    The named worksheets should be in a single 'reuseable' array, to allow easy adds/removes in future.

    I will own the right to re-use and/or distribute the code as I see fit.

    If anyones interested let me know how the commercial services works and how much you want to do it.

    Thanks.
    Martin
    Last edited by mc1903; 09-01-2017 at 04:28 AM.

  2. #2
    Registered User
    Join Date
    10-19-2012
    Location
    UK
    MS-Off Ver
    Excel 2013/2016
    Posts
    4

    Re: VBA code to copy multiple worksheets between work books.

    BUMP... Anyone interested in earning a few quid for an hour or so's work over the weekend?

+ 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. create multiple work books with multiple tabs
    By jlsbexcel in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-05-2013, 09:05 AM
  2. Creating one excel sheet from multiple work books that we have.
    By prasanthkantu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-25-2013, 07:19 PM
  3. Macro for merging multiple work books
    By sridileep in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-21-2013, 01:37 AM
  4. [SOLVED] Need Macro to copy data from a single sheet from work books in the same directory.
    By bird970 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2012, 06:10 PM
  5. Excel 2007 : merge Multiple Work Books
    By stinkyrob in forum Excel General
    Replies: 0
    Last Post: 10-21-2009, 03:03 PM
  6. Copy multiple cells from several work books to one workbook
    By Blur1973 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-20-2008, 08:20 PM
  7. Replies: 0
    Last Post: 12-19-2005, 07:45 PM
  8. Replies: 2
    Last Post: 11-11-2005, 05:50 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