+ Reply to Thread
Results 1 to 2 of 2

Help with copy an array from one workbook to another

Hybrid View

  1. #1
    Registered User
    Join Date
    04-20-2005
    Posts
    52

    Help with copy an array from one workbook to another

    Hi Excel Guru's

    Thanks so much for all the help so far.

    I need to copy an b2:I65 from one workbook to another.
    The workbook with the live data will be closed.
    I need it to copy into the same cells B2:i65 and write over the data that is already existing.

    (What I am doing is displaying months of data in the smae b2:i65 cells.

    So was going to have buttons across the top with months on them and whatever month is selected then the data in the Master workbook will be copied into the above cells in the slave workbook.

  2. #2
    Forum Contributor
    Join Date
    11-09-2004
    Posts
    451
    Backup your workbooks before trying this macro.

    ok let say you want to copy from workbook x.xls which is in "c:\" and file is not opened.

    you can write a macro to copy data from x.xls to the workbook which as macro using code below.


    sub macro
    dim w,n as variant
    application.displayalerts=false
    w=activeworkboook.name
    Workbooks.Open Filename:="c:\x.xls"
    n=activeworkbook.name
    range("b2:i65").select
    selection.copy
    workbooks(w).activate
    range("b2").select
    activesheet.paste
    workbooks(n).activate
    activeworkbook.save
    activeworkbook.close
    workbooks(w).activate
    application.displayalerts=true
    end if

+ 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