Copy Paste Values only( xlPasteValues )

The Solution to Copy Paste Values only( xlPasteValues ) is

If you are wanting to just copy the whole column, you can simplify the code a lot by doing something like this:

Sub CopyCol()


    Sheets("Sheet2").Columns(2).PasteSpecial xlPasteValues

End Sub


Sub CopyCol()


    Sheets("Sheet2").Columns("B").PasteSpecial xlPasteValues

End Sub

Or if you want to keep the loop

Public Sub CopyrangeA()

    Dim firstrowDB As Long, lastrow As Long
    Dim arr1, arr2, i As Integer

    firstrowDB = 1
    arr1 = Array("BJ", "BK")
    arr2 = Array("A", "B")

    For i = LBound(arr1) To UBound(arr1)


        Sheets("Sheet2").Columns(arr2(i)).PasteSpecial xlPasteValues

    Application.CutCopyMode = False

End Sub

~ Answered on 2014-05-29 16:01:52

Most Viewed Questions: