VBA for IF formulas

newshound12

Active Member
Joined
Feb 19, 2003
Messages
339
=IF(DO32="",0,IF(CE31+DO32>DO35,B32,IF(CE31+DO32<DO36,-B36,"0")))

=IF(DO41="",0,IF(CE40+DO41>DO44,B41,IF(CE40+DO41<DO44,-B45,"0")))

=IF(DO50="",0,IF(CE49+DO50>DO53,B50,IF(CE49+DO50<DO53,-B54,"0")))

These formulas start in DO32 and end in DO923.
Each are 9 rows apart.
Need a macro to run these formulas and convert them to values
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
The formula was deleted by the forum editor, add a space before and after each symbol < > and paste again your formula.

=IF(DO32="",0,IF(CE31+DO32 > DO35,B32,IF(CE31+DO32
 
Upvote 0
Can you provide the complete formula....I'm guessing they use an " < " sign, which will require a space either side of it to make it appear.
But it's simply the same as the last answer I provided but including the new formula

Code:
Sub MM1()
Dim r As Long
Application.ScreenUpdating = False
For r = 32 To 923 Step 9
    With Range("DQ" & r)
        .Formula = "=HH" & r - 1 & "+HH" & r & "+HH" & r + 3 & "+HH" & r + 4 & ""
        .Value = .Value
    End With
Next r
Application.ScreenUpdating = True
End Sub
 
Last edited:
Upvote 0
=IF(DO32="",0,IF(CE31+DO32>DO35,B32,IF(CE31+DO32<DO35,-B36,"0")))
=IF(DO41="",0,IF(CE40+DO41>DO44,B41,IF(CE40+DO41<DO44,-B45,"0")))
=IF(DO50="",0,IF(CE49+DO50>DO53,B50,IF(CE49+DO50<DO53,-B54,"0")))

Probably my fault copying it from another sheet
 
Upvote 0
Is it to be done in conjunction with the other formula in the previous macro ??
 
Upvote 0
keeps getting chopped up.
=IF(DO32="",0,
IF(CE31+DO32>
DO35,B32,
IF(CE31+DO32<
DO35,-B36,"0")))


=IF(DO41="",0,
IF(CE40+DO41>
DO44,B41,
IF(CE40+DO41<
DO44,-B45,"0")))


=IF(DO50="",0,
IF(CE49+DO50>
DO53,B50,
IF(CE49+DO50<
DO53,-B54,"0")))
 
Last edited:
Upvote 0
Are you putting a space either side of the < > signs ?
AND
you only need to post the first occurence of the formula, not what will be on the other lines
 
Upvote 0
This still doesn't seem right -B36 ??

Code:
=IF(DO32="",0,IF(CE31+DO32>DO35,B32,IF(CE31+DO32<DO35, -B36,"0")))
 
Last edited:
Upvote 0
No space.
Copied formula from worksheet.
Formula works on work sheet.
Need to get rid of formulas slowing up worksheet.
 
Upvote 0

Forum statistics

Threads
1,215,607
Messages
6,125,818
Members
449,262
Latest member
hideto94

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