Results 1 to 3 of 3

Macro failed to copy and paste data range

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-12-2009
    Location
    Hendersonville, TN
    MS-Off Ver
    Excel 2010
    Posts
    113

    Macro failed to copy and paste data range

    Greetings,

    I have been trying to find a macro that can copy a range of data (A2:Q2) from a worksheet and paste it to the next available row (A:Q) of a worksheet in a different workbook. I am trying to get the 2nd workbook to be a running log of entries pulled from the 1st workbook. Anyway, I have had no luck trying to rework some of the macros I have seen due to various types of errors I have be unable to debug.

    The code I am curently messing with acts like it is trying, but the desired data set doesn't make it to the 2nd workbook. I was hoping one of you all could give it a look and steer me down the right path. I know nothing of VBA and I have been looking for cookie-cutter solutions for my task.

    Sub Copytolog()
    
    Dim source As Range, dest As Range
    Workbooks.Open FileName:="C:\Users\patrick\desktop\vandy stuff\working files\monthly log sheet.xlsx"
    
    Set source = Workbooks("Tech form 4.0.xlsm").Worksheets("Pull sheet").Range("A2:Q2").End(xlUp)
    Set dest = Workbooks("Monthly Log Sheet.xlsx").Worksheets("Sheet 1").Range("A2:Q2").End(xlUp)
    source.Copy
    dest.PasteSpecial
    ActiveWorkbook.Close True
    End Sub
    Thank you for your time and assistance.

    Patrick
    Last edited by pjbassdc; 09-02-2011 at 07:38 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