Results 1 to 14 of 14

Copy/Paste, between open workbooks,syntax

Threaded View

  1. #1
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Copy/Paste, between open workbooks,syntax

    I am having a little trouble figuring out the syntax for coping and pasting between different workbooks. Can anyone show me how to write the syntax for this?

    This is what I have so far, it is not finished so obviously won't work.

    Sub Datacopy()
    '
    ' Datacopy Macro
    '
    
    '
        Dim wbData As Workbook 'The WB to be transferring data from.
        Dim wsSheet As Worksheet 'The WS to be transferring data from.
        Dim wbs As Workbook  'The WB to be transferring data to.
        Dim wks As Worksheet 'The WS to be transferring data to.
        
        
            Set wbData = Workbooks("Data")
               wbData.Activate
            
            Set wbSheet = Worksheets("Record")
                 wbSheet.Cells(2, 4).Copy
               
            Set wbs = Workbooks("NewBook")
            
            Set wks = Worksheets("Report")
            
                 Destination:=wks.Cells(2, 4)
        
        
    End Sub
    Last edited by JapanDave; 08-31-2011 at 09:12 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