COPY VALUES, NO FORMULAS. EXCEL VBA

ぃ、小莉子 提交于 2019-12-12 01:29:06

问题


I am writting a code to copy a sheet from one workbook(W1) to another workbook(W2). I know how to do it, but the problem is the copied sheet in W2 still has the formulas and references from W1, and I don't want that I just want the values.

This is my code to copy the sheet:

    Set W1 = Workbooks("REPORT1.xlsx")
    Set W2 = Workbooks("REPORT2.xlsx")
    W1.Sheets("TEST").Copy After:=W2.Sheets(wb.Sheets.Count)

Any thoughts. Thanks


回答1:


Set W1 = Workbooks("REPORT1.xlsx")
Set W2 = Workbooks("REPORT2.xlsx")
W1.Sheets("TEST").Copy After:=W2.Sheets(wb.Sheets.Count)
ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value


来源:https://stackoverflow.com/questions/14981582/copy-values-no-formulas-excel-vba

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