Results 1 to 3 of 3

Copy Worksheet (from another workbook) to an Active Workbook

Threaded View

  1. #1
    Registered User
    Join Date
    03-29-2007
    MS-Off Ver
    365
    Posts
    70

    Copy Worksheet (from another workbook) to an Active Workbook

    Hi All,

    I am trying to create a VB code that can copy a specific tab from a specifc file to the active file that is opened.

    
    Sub CopyWB()
    
    Dim curWorkbook As Workbook
    
    Set curWorkbook = ActiveWorkbook.Name
    Workbooks.Open Filename:= "C:\QA.xlsx"      'Copy "QA" tab from "QA.xlsx to the active open file
    Sheets("QA").Move Before:=curWorkbook.Sheets(1)
    
    End Sub

    However, it gives me an error when referencing to the active book. Any helps is greatly appreciated.

    Thanks...
    Last edited by tt388; 09-08-2012 at 09:48 PM.

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