Results 1 to 6 of 6

Move tab from Workbook1 to Workbook2 using Macro VBA

Threaded View

  1. #1
    Registered User
    Join Date
    06-10-2010
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    70

    Move tab from Workbook1 to Workbook2 using Macro VBA

    I have workbook1 open and I want to move one of its tabs to workbook2.
    Workbook1 and workbook2 may vary. I used the "Application.GetOpenFilename" to open workbook1 and now I have
    to use it to open workbook2.
    This is what I have so far.
    Sub Transfer_Button()
    ''open workbook2
    aux = Application.GetOpenFilename("Nam22, *.*")
    If aux <> False Then Workbooks.Open aux
    
    'So I want to take the DATA tab  from workbook1(which may also vary), 
    'But since I just 'open WB2, it will try to perform the action in WB2.
    
    Sheets("DATA").Select
    
    ''''WB1("DATA Tab") ====> WB2
    
    Sheets("DATA").Move Before:=Workbooks("Workbook2??").Sheets(1)
    
    End Sub
    This is kinda confusing because I dont want to use any specific names since both WB1 and WB2 may vary,
    Do you follow?

    Any Ideas??
    Last edited by nachousa; 07-08-2010 at 08:51 AM.

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