问题
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