EXCEL VBA: Copy Formula from one workbook, paste as value in the Active workbook

1168 views excel-vba
1

Sub somemodule()

Set Src = Workbooks("Abc")
Sheets("Thissheet").Select
Src.Sheets("Thatsheet").Range("P22:P35").CopyRange("Q5")

End Sub

Source range P22:P35 is formula. So this copies the formula.

I want to paste only values. So I did this.

Src.Sheets("Thatsheet").Range("P22:P35").CopyRange("Q5").PasteSpecial

This gives Run-time Error '1004'

or this,

Src.Sheets("Thatsheet").Range("P22:P35").CopyRange("Q5").PasteSpecialxlPasteValues

Gives compile error: Expected End of statement.

Please help me copy values into the active sheet. Thank you.

answered question

1 Answer

Have an answer?

JD

Please login first before posting an answer.