+ Reply to Thread
Results 1 to 3 of 3

Copying static cells in a loop....Paste Special problems

  1. #1

    Copying static cells in a loop....Paste Special problems

    Here is my query:
    ' Detail Machine Code, PCI, and Agreement type Column
    'Set ws1 = Worksheets("Calc")
    'Set ws2 = Worksheets("Generator")
    Dim lastrowDMC As Long
    Dim rDMC As Long, rrDMC As Long
    rrDMC = 14
    Dim DMC As Long
    DMC = Range("I11").Copy
    With ws2
    lastrowDMC = .Cells(Rows.Count, "B").End(xlUp).Row
    For rDMC = 14 To lastrowDMC
    Range("I11").Select
    Selection.Copy
    ws2.Cells(rrDMC, "C") = Selection.PasteSpecial '_
    'Paste:=xlPasteValues, Operation:=xlNone,
    SkipBlanks:=False, Transpose:=False

    rrDMC = rrDMC + 1
    Next rDMC
    End With


    It is supposed to take the cell I11, and copy it, adn then paste it in
    a loop to the column C starting at row 14, and then going down the
    column to the last row I counted....However, I can't get it to do a
    pastespecial..it keeps putting a value of "true" in the cells since I11
    is a formula. I get a syntax error if I uncomment the
    Paste:x1PasteValues.. line. Help?


  2. #2
    Dave Peterson
    Guest

    Re: Copying static cells in a loop....Paste Special problems

    You have replies at your other post.

    [email protected] wrote:
    >
    > Here is my query:
    > ' Detail Machine Code, PCI, and Agreement type Column
    > 'Set ws1 = Worksheets("Calc")
    > 'Set ws2 = Worksheets("Generator")
    > Dim lastrowDMC As Long
    > Dim rDMC As Long, rrDMC As Long
    > rrDMC = 14
    > Dim DMC As Long
    > DMC = Range("I11").Copy
    > With ws2
    > lastrowDMC = .Cells(Rows.Count, "B").End(xlUp).Row
    > For rDMC = 14 To lastrowDMC
    > Range("I11").Select
    > Selection.Copy
    > ws2.Cells(rrDMC, "C") = Selection.PasteSpecial '_
    > 'Paste:=xlPasteValues, Operation:=xlNone,
    > SkipBlanks:=False, Transpose:=False
    >
    > rrDMC = rrDMC + 1
    > Next rDMC
    > End With
    >
    > It is supposed to take the cell I11, and copy it, adn then paste it in
    > a loop to the column C starting at row 14, and then going down the
    > column to the last row I counted....However, I can't get it to do a
    > pastespecial..it keeps putting a value of "true" in the cells since I11
    > is a formula. I get a syntax error if I uncomment the
    > Paste:x1PasteValues.. line. Help?


    --

    Dave Peterson

  3. #3

    Re: Copying static cells in a loop....Paste Special problems

    Yep..sorry about this..I submitted it at 11:30, and it just showed up.


+ 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.6.0 RC 1