Editing an "IF" function across a worksheet/excel file

C

Cedric Dennis

Hi
I have about a 1000 formulae using the function "IF" across many
worksheets in an excel file.
eg: =IF(C1315>0,ROUND(C1315+15,-1),"")
I wish to change the number 15 to 25 across all IF functions in the
worksheet and in all worksheets in the file.
Is there as easy way to do it ?
Any help is appreciated.
Thanks for taking the time.
Regards
Cedric
 
D

Don Guillett

This will do it however be advised that ANY formula that has +15
anywhere in the formula will change. If ?? that is a problem, post
back.

Sub changeformulas()
For Each ws In Worksheets
ws.Cells.SpecialCells(xlCellTypeFormulas).Replace "+15", "+42"
Next ws
End Sub
 
G

Gord Dibben

Group the sheets then Edit>Replace

What: +15

With: +25

Replace all

Make sure you set Options>Within to Workbook

Note Don's caveat.


Gord
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top