Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert all formulas to values

Status
Not open for further replies.

MeisoT

Technical User
Apr 25, 2004
43
US
I would like to convert all formulas in a worksheet to values. The code below works for one specific range, but I need to cycle through all the ranges in the worksheet to convert the formulas to values.

Dim c As Range

For Each c In ThisWorkbook.Worksheets("Sheet 1").Range("B5")
If c.HasFormula Then
c = c.Value
End If
Next c

How do I cycle through all the ranges in the worksheet?

Excel version=2000

Thanks.
 
An easier way might be to use Paste Special. In the sheet press Ctrl+A, Ctrl+C and then from the Edit menu, select Paste Special and then select the Values option.

Hope this helps.
 
Thanks earthandfire. I was able to record your suggestion to get the VBA equivalent and it works great!

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top