+ Reply to Thread
Results 1 to 2 of 2

Copy Range puzzle

  1. #1
    Registered User
    Join Date
    09-11-2012
    Location
    York, England
    MS-Off Ver
    Excel 2007
    Posts
    39

    Copy Range puzzle

    Hi guys and girls,

    Anyone know how to solve this little puzzle?

    I'm trying to copy each cell from a range depending on whether a condition is met in an adjacent column i.e. value in the range = 1, to a location on another worksheet. However when I run the macro I keep getting the error "Run-time error 1004: copy method of the range class failed". The help on the MSDN website doesn't seem to apply to me.

    Any help would be great!

    Thanks
    J
    PHP Code: 

    Sub CreateBuySD
    ()
        
    Dim SD1 As Worksheet
        Dim SD2 
    As Worksheet
        Set SD1 
    Worksheets(1)
        
    Set SD2 Worksheets(2)
        
    Dim BuyRange As Range
        Set BuyRange 
    SD1.Range("P4,P1004")
        
    Dim DestRange As Range
        Set DestRange 
    SD2.Range("A1")
        
    Dim signal As Variant
        
    For Each signal In BuyRange
            Dim Change 
    As Range
            Set Change 
    signal.Offset(-11)
            If 
    signal 1 Then
                Change
    .Copy Destination:=DestRange.End(xlDown).Row
            End 
    If
        
    Next signal
    End Sub 

  2. #2
    Registered User
    Join Date
    09-24-2013
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Copy Range puzzle

    In the line
    Please Login or Register  to view this content.
    you want copy Range into number. In Destination you must show a range too

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Number Puzzle
    By PetaPan via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2006, 12:45 PM
  2. Excel Puzzle
    By dwalesb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-26-2006, 02:30 PM
  3. Can you help!!!!! New Puzzle
    By Krefty in forum Excel General
    Replies: 0
    Last Post: 06-13-2005, 04:05 PM
  4. concatenating puzzle
    By Papa Jonah in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-18-2005, 10:06 AM

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