COPY VALUES, NO FORMULAS. EXCEL VBA

2019-08-30 11:13发布

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条回答
爷、活的狠高调
2楼-- · 2019-08-30 11:42
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
查看更多
登录 后发表回答