Kevin
There appears to be a bit of confusion as to what you are asking for here.
The way I understand it is you want to populate Column I with the RESULTS
of
subtracting column H from Column F. If this is the case then run the macro
below. Save your work first just in case. I did note that at some stage
the
request changed to Column F - Column G. I have provided for this as well.
To subtract column H from column F
Sub PopCol()
Dim endRow As Long
endRow = Cells(Rows.Count, 6).End(xlUp).Row
With Range(Cells(2, 9), Cells(endRow, 9))
.FormulaR1C1 = "=RC[-3]-RC[-1]" 'this is F-H
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Application.CutCopyMode = False
End Sub
To subtract column G from Column F:
Sub PopCol()
Dim endRow As Long
endRow = Cells(Rows.Count, 6).End(xlUp).Row
With Range(Cells(2, 9), Cells(endRow, 9))
.FormulaR1C1 = "=RC[-3]-RC[-2]" 'this is F-G
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Application.CutCopyMode = False
End Sub
Hope this helps
Rowan
Kevin Baker said:
Would like to use VB Code to do the following:
=F2-H2
Thanks,
Kevin