Dear All,
I have a spreadsheet with the following columns:
Index RF CDS ADJSPRD POSITION
A 220 172 0.077 UP
B 220 142 0.77 UP
C 20 14 0.77 DOWN

What I am aiming to do is follows:
1. Sum up all the RF values in this column, for values above an input "target" currently set at default of 225, my code for this proceedure is :

target = InputBox("Please enter the CDS target level for filter", "CDS Target", 225)
Range("W3").Value = target

Similarly, I will filter out and sum up the corresponding values for the CDS and ADJ SPREAD for all values above 225.

I will then dump this data out into cells - then I will go back and redo this only this time adding the condition that it will have to be either "positive " and > 225 (i.e effectivly remove all "down" data).

My code for this is along the lines:
Sub PreOptimisation()
MsgBox ("Default target set to 225, Option to Change will be given later")
Range("T6").Select
ActiveCell.Formula = "=SUM(G5:G700)/225"

Range("T7").Select
ActiveCell.Formula = "=SUM(H5:H700)/225"



MsgBox "Works so far.... "

End Sub

Sub CheckCDS()
Dim target As Single
target = InputBox("Please enter the CDS target level for filter", "CDS Target", 225)
Range("W3").Value = target
Range("T15").Select


ActiveCell.FormulaR1C1 = _
"=SUMIF(R[-10]C[-12]:R[609]C[-12],"">=225"", R[-10]C[-12]:R[609]C[-12]) /225"

Range("T16").Select






End Sub


Q1. is there a neater way of performing this? using RC11 formatting is complicating.
Q2. How can i use the "target" variable rather than hard code 225 into the script?


Many thanks!
Mp16