+ Reply to Thread
Results 1 to 3 of 3

Thread: Change code to copy as values

  1. #1
    Valued Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    706

    Change code to copy as values

    How can I change the copy Destination: line of code to copy as values?

    
    i = 105
    P = 5
    Do Until shtL.Cells(i + 4, 3) = ""
     
        Set rCopy = shtL.Cells(i, 47).Resize(1, 223)
    
            If shtL.Cells(i, 3).End(xlDown).row < 109 Then
                rCopy.copy Destination:=shtL.Cells(5, 47)
            Else
                rCopy.copy Destination:=shtL.Cells(P, 47)
            End If
    
        i = i + 7
        P = P + 1
    Loop
    Last edited by rhudgins; 10-25-2010 at 01:26 PM.

  2. #2
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,224

    Re: Change code to copy as values

    You can use the PasteSpecial method, requiring the destination command on a line of its own:

    i = 105
    P = 5
    Do Until shtL.Cells(i + 4, 3) = ""
     
        Set rCopy = shtL.Cells(i, 47).Resize(1, 223)
    
            rCopy.Copy 
    
            If shtL.Cells(i, 3).End(xlDown).row < 109 Then
                shtL.Cells(5, 47).PasteSpecial xlPasteValues
            Else
                shtL.Cells(P, 47).PasteSpecial xlPasteValues
            End If
    
        i = i + 7
        P = P + 1
    Loop
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Valued Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    706

    Re: Change code to copy as values

    thank you.

+ 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.2.0