Search code examples
vbaexcelcopy-paste

PasteSpecial only values


I want to copy paste a range of cells into a destination sheet, but only their values, not the format. Unfortunately, my code pastes the format, too. I am providing the line of code for this purpose. (I know how to paste special values but I want, if it is possible, to apply this method for this method of copy paste. Normally, I use a different copy paste method, for which I know how to paste special, but for this time I wanted to keep the length of the macro as small as possible).

ws1.Range("C2:C" & lastrow2).Copy ws2.Range("A2")

Solution

  • Would recommend:

    ws2.Range("A2:A" & lastrow2).Value = ws1.Range("C2:C" & lastrow2).Value