Results 1 to 4 of 4

Macro to copy from one workbook to a different workbook

Threaded View

  1. #1
    Registered User
    Join Date
    05-19-2014
    Location
    Charlotte, NC, USA
    MS-Off Ver
    2007 (2010 at temp job)
    Posts
    3

    Macro to copy from one workbook to a different workbook

    I need to copy data from one workbook to another workbook. The problem is that the receiving workbook will always have a different name. Here is my macro:

    Sub Add_Units_Worksheet()
    '
    ' Add_Units_Worksheet Macro
    '
        Sheets.Add After:=Sheets(Sheets.Count)
        Sheets("Sheet2").Select
        Sheets("Sheet2").Name = "Units"
        Windows("Test File.xls").Activate
        Range("A1").Select
        ActiveSheet.Paste
        Cells.Select
        Cells.EntireColumn.AutoFit
        Range("A1").Select
    
    End Sub
    I need the line Windows("Test File.xls").Activate to allow the user to choose the file to be activated, preferably without having to type in a file name. This file will already be open.

    Any help anyone can provide would be much appreciated.

    Thanks.
    Mikki
    Last edited by MsMikkiC; 05-20-2014 at 08:42 AM. Reason: add information, add code tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to find data in source workbook and copy paste to target workbook
    By D.Lovell in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-23-2014, 06:21 AM
  2. Run Macro in closed workbook and copy specific coloumn in active workbook
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-07-2013, 03:43 AM
  3. Replies: 9
    Last Post: 06-24-2013, 04:14 PM
  4. Replies: 0
    Last Post: 04-26-2013, 03:40 AM
  5. Macro to copy data from other workbook - let user choose which open workbook
    By ssu95bm in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-12-2011, 11:17 AM

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