Small Paul
Board Regular
- Joined
- Jun 28, 2018
- Messages
- 118
Hi All
I am trying to use an IF statement in a VBA and am struggling!
A section of the range (in columns E & F) is below:
[TABLE="width: 240"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD] 500,000[/TD]
[TD] 263,000[/TD]
[/TR]
[TR]
[TD] 500,000[/TD]
[TD] 544,000[/TD]
[/TR]
[TR]
[TD] 500,000[/TD]
[TD] 383,000[/TD]
[/TR]
[TR]
[TD] 500,000[/TD]
[TD] 294,000[/TD]
[/TR]
[TR]
[TD] 650,000[/TD]
[TD] 563,000[/TD]
[/TR]
[TR]
[TD] 650,000[/TD]
[TD] 386,000[/TD]
[/TR]
[TR]
[TD] 1,000,000[/TD]
[TD] 980,224[/TD]
[/TR]
[TR]
[TD] 1,000,000[/TD]
[TD] 1,422,480[/TD]
[/TR]
[TR]
[TD] 500,000[/TD]
[TD] 462,000[/TD]
[/TR]
</tbody>[/TABLE]
I need to show the difference, for each row, in column H. Easy as a one off : =if(E4>0,E4-F4,"") and copy down!
Can anybody please advise?
Many thanks
Small Paul.
I am trying to use an IF statement in a VBA and am struggling!
A section of the range (in columns E & F) is below:
[TABLE="width: 240"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD] 500,000[/TD]
[TD] 263,000[/TD]
[/TR]
[TR]
[TD] 500,000[/TD]
[TD] 544,000[/TD]
[/TR]
[TR]
[TD] 500,000[/TD]
[TD] 383,000[/TD]
[/TR]
[TR]
[TD] 500,000[/TD]
[TD] 294,000[/TD]
[/TR]
[TR]
[TD] 650,000[/TD]
[TD] 563,000[/TD]
[/TR]
[TR]
[TD] 650,000[/TD]
[TD] 386,000[/TD]
[/TR]
[TR]
[TD] 1,000,000[/TD]
[TD] 980,224[/TD]
[/TR]
[TR]
[TD] 1,000,000[/TD]
[TD] 1,422,480[/TD]
[/TR]
[TR]
[TD] 500,000[/TD]
[TD] 462,000[/TD]
[/TR]
</tbody>[/TABLE]
I need to show the difference, for each row, in column H. Easy as a one off : =if(E4>0,E4-F4,"") and copy down!
Code:
Range("H4:H2533").Select ActiveCell.FormulaR1C1 = "=if(E4>0,E4-F4,"""
Can anybody please advise?
Many thanks
Small Paul.