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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

daniels012

Well-known Member
Joined
Jan 13, 2005
Messages
5,219
Do you mean something like:

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

(This is using VBA code by the way)

Michael
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,454
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?
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,454
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?
 

Forum statistics

Threads
1,136,272
Messages
5,674,757
Members
419,525
Latest member
helensesc

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
Top