copying formula to value

ehsas69

Board Regular
Joined
Jan 10, 2004
Messages
221
I have a excel sheet with formula where extract the data from different sheet.Is there anyway set formula back value for certain cells.

Thanks
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Do you mean something like:

Range("C4").Value = Range("C4").Value

(This is using VBA code by the way)

Michael
 
Upvote 0
I'm not sure I understand what you're looking for.
Are you just wanting to convert some formulas to static values?
You can copy them and PasteSpecial as Values.

If you're looking for code to do it, it would look something like this.
Code:
With Range("A2:A4")
  .Value = .Value
End With
If it's a non-continuous range. . .
Code:
With Range("A2, A4")
  .Value = .Value
End With

If this isn't what you meant then can you explain a bit further?
 
Upvote 0
OK, with the workbook open:
To Install the code:
1) Press Alt+F11, then Ctrl+R
2) In the left of the two windows that will open, locate the name of your workbook and
click on it once.
3) From the menu, choose Insert and then Module.
4) Copy the code you wish to use from below and paste it into the white area on
the right that is the module you just inserted.
(Note, you will only need one or the other, but not both.)
Code:
Sub ConvertContinuousRange()
'convert the entire range A2 to A4
  With Range("A2:A4")
    .Value = .Value
  End With
End Sub


Sub ConvertNonContinuousRange()
'convert just the cells A2 and A4
  With Range("A2, A4")
    .Value = .Value
  End With
End Sub
5) Change the range(s) referenced in the code to the range(s) you're interested in.
6) Press Alt+Q to get back to your worksheet.

Now, to run the code:
1) With the worksheet containing the formulas you wish to convert being the active sheet,
press Alt+F8
2) select the name of the macro you installed/want to run.
3) Click Run

Does that help?
 
Upvote 0

Forum statistics

Threads
1,214,973
Messages
6,122,534
Members
449,088
Latest member
RandomExceller01

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