VBA - out of memory error when copying and pasting data

433 views Asked by At

In a worksheet, I have a large number of formulas/data/cells. I want to paste them as values and then save/close the file. I have the following code:

With Workbooks("Sample Workbook").Worksheets("Sheet1").UsedRange
    .Value = .Value
End With
Workbooks("Sample Workbook").Save
Application.Quit

However, the code gives the out of memory error at .Value = .Value line. How do I fix it?

0

There are 0 answers