+ Reply to Thread
Results 1 to 6 of 6

VBA to Copy specific sheets from one workbook to another workbook

  1. #1
    Registered User
    Join Date
    07-18-2012
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    3

    VBA to Copy specific sheets from one workbook to another workbook

    Hello

    I hav 23 sheets in workbook1 but i want to copy the whole content of specific 17 sheets oly from workbook1 to another workbook2 ??
    searched in google but didnt find any relevent code

    Please help

    Thanks

    Abhi

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA to Copy specific sheets from one workbook to another workbook

    Is there already data existing in workbook2?

    What is the data range that needs to be copied? In other words, which columns?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    07-18-2012
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: VBA to Copy specific sheets from one workbook to another workbook

    Yes..data exists in workbook2...but i want to replace watever data is there in workbook2..
    whole content i want to copy from workbook1 to workbook2..

    thanks for the reply

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA to Copy specific sheets from one workbook to another workbook

    Do you need the macro to open workbook2 for you or will it be open at the time of running the macro?

  5. #5
    Registered User
    Join Date
    07-18-2012
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: VBA to Copy specific sheets from one workbook to another workbook

    yes i need macro to open workbook and also for copying

    Thanks

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA to Copy specific sheets from one workbook to another workbook

    Try this code. Copy it into your source file.
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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