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

一笑奈何 提交于 2021-02-11 15:45:54

问题


I want to copy 10 rows from a workbook into a new workbook. The copy & 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

回答1:


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


来源:https://stackoverflow.com/questions/2175993/excel-vba-copy-rows-from-another-workbook-but-just-the-function-results

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!