Changing Multiple Formulas

  • Thread starter John Pivot Table
  • Start date
J

John Pivot Table

Hi,

I have a file with literally hundredths of formulas and I need to do the
same change in all of them; if a certain cell is empty the formulas shouldn´t
display anything at all.

Is there any way I can change all formulas at once???? I cannot click and
drag because every formula does a different thing.

thanks!
 
J

John Pivot Table

Worked great, Rick!

Thanks!


Rick Rothstein said:
I think this macro may do what you want...

Sub FixFormulas()
Dim C As Range
For Each C In Selection
C.Formula = "=IF(B4="""",""""," & Mid(C.Formula, 2) & ")"
Next
End Sub

Just change the B4 cell reference to whatever cell you want to test for
empty, then select all the cells you want to make this change to and then
run the macro. You might try this out on a copy of your worksheet first as
the changes it makes cannot be undone.
 
X

xlsmate

Every cell has a different formula, but I need almost every single one to
start like this:

=IF($B16="","",ORIGINAL FORMULA)

Hopefully the B16 will change according to the row...








- Show quoted text -

Try this macro,

Sub AddIf()

For Each C In Selection
C.Formula = "=IF(B16=""""," & Right(C.Formula, Len(C.Formula)
- 1) & ",0)"
Next C
End Sub

Hope this help

cheers
 

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