开发者

Excel VBA: Copy rows from another workbook, but just the function results

开发者 https://www.devze.com 2022-12-19 06:18 出处:网络
I want to copy 10 rows from a workbook into a new workbook. The cop开发者_JAVA技巧y & paste is fine, but in the copied cells are some formulas that I need to replace with the results.

I want to copy 10 rows from a workbook into a new workbook. The cop开发者_JAVA技巧y & paste is fine, but in the copied cells are some formulas that I need to replace with the results.

Is there a magical way to copy only the displayed values from the cells?

This is how I do it now:

Rows("2:11").Select
Selection.Copy
myWorkbook.Sheets(1).Activate
ActiveSheet.Rows("1:10").Select
ActiveSheet.Paste


Rows("2:11").Copy
myWorkbook.WorkSheets(1).Rows("1:10").PasteSpecial xlPasteValues
Application.CutCopyMode = False
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号