Member Rara Avis
If you insist, Karen...
code:If you'll notice, the above formula has been seen in a similar form before, in this very same forum.
testCell = Cells(row_unq, col_unq)
testCell2 = Cells(row_trf, col_trf)
'Tests if this is a row with a plan in it
If testCell2 = "False" Then
ba = Cells(row_act, col_act) 'Define row and column for actual price
sc = Cells(row_sup, col_sup) 'Define row and column for supplier cost
sp = Cells(row_spt, col_spt) 'Define row and column for specialty items
Sum = ((ba - sc - sp) - hd * (sc + sp)) / (hd + 1)
Cells(row_con, col_con) = Sum 'Write contingency cost into cell
If ba > 0 Then
countPlans = countPlans + 1
'The following increases row count to go to next row
row_act = row_act + 1
row_sup = row_sup + 1
row_spt = row_spt + 1
row_trf = row_trf + 1
row_unq = row_unq + 1
row_con = row_con + 1
Loop While testCell = "~xx~"