vba to copy range containing formulas and paste back values in the same range

rjheibel

New Member
Joined
Mar 8, 2018
Messages
45
Office Version
  1. 365
Platform
  1. Windows
I am trying to copy a range with formulas and paste back values only in the same range. I tried the statement below, but it replaces formulas with blanks. Attempting to do this action without actually selecting that sheet if possible. What would be the best way to accomplish this?

Worksheets("Previous Week Performance").Range("A4:AE1050").Value = Worksheets("Previous Week Performance").Range("A4:AE1050").Value

Thanks!
 
That statement looks correct to value over formulas. If the formulas result to a null value such as "", then you will get null string cells.

Are you trying to say that the formulas result to numbers and that statement turns them into blanks?
 
Upvote 0
Your right. That statement is working. I changed to that after the statement below did not work. Is there another way to write this statement within the With Statement? As written, when the second statement runs, it clears everything out. seems like it doesn't want to copy formulas back as values.

With Worksheets("Previous Week Performance")
.Range("A4:AE1050").Formula = .Range("A4:AE4").Formula
.Range("A4:AE1050").Value = .Range("A4:AE4").Value
End With
 
Upvote 0
You got the last range wrong in the penultimate line:

VBA Code:
.Range("A4:AE1050").Value = .Range("A4:AE1050").Value
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top