Results 1 to 7 of 7

Macro to copy non adjacent cells to external workbook and move down row

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-05-2009
    Location
    South Dakota, USA
    MS-Off Ver
    365
    Posts
    152

    Macro to copy non adjacent cells to external workbook and move down row

    I have been looking around trying to find a code to copy data from nonajadcent cells into another workbook. I finally found this code and modified it to fit my needs.

    I keep getting a run-time error '9' Subscipt out of range.

    Could someone tell me what my problem is without me uploading the workbooks?

    Once I get the first line to work as needed, I have about twenty cells to copy/paste which I can do.

    Thanks in advance

    Sub CopySpecial()
    Const SourceSheet = "Form"
    Const TargetSheet = "Logbook"
    Const ExternalWorkbook = "2010 Logbook.xls"
    
    Sheets(SourceSheet).Range(Call_Number).Copy Destination:=Workbooks(ExternalWorkbook).Sheets(TargetSheet).Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
    'Sheets(SourceSheet).Range("$C$12").Copy Destination:=Workbooks(ExternalWorkbook).Sheets(TargetSheet).Cells(Rows.Count, 1).End(xlUp).Offset(0, 2)
    'Sheets(SourceSheet).Range("$E$18").Copy Destination:=Workbooks(ExternalWorkbook).Sheets(TargetSheet).Cells(Rows.Count, 1).End(xlUp).Offset(0, 3)
    'Sheets(SourceSheet).Range("$G$59").Copy Destination:=Workbooks(ExternalWorkbook).Sheets(TargetSheet).Cells(Rows.Count, 1).End(xlUp).Offset(0, 4)
    
    End Sub
    Last edited by 2funny4words; 04-06-2010 at 04:59 PM. Reason: additional info

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