Adding and subtrating from rates.
How about something like this:
Sub RunAdjProcess()
AdjRange Range("YourNamedRange"), 0.075
End Sub
Sub AdjRange(TargetRng As Range, AdjVal As Double)
Dim C As Range
Dim CurrentFormula As String
For Each C In TargetRng
If IsEmpty(C) = False Then
If IsNumeric(C.Value) Then
If C.HasFormula Then
CurrentFormula = C.Formula
C.Formula = "=(" & Mid(CurrentFormula, 2, 500) _
& ")+" & CStr(AdjVal)
Else
C.Value = C.Value + AdjVal
End If
End If
End If
Next
End Sub
You could trigger this to run via a button or perhaps the
Worksheet_Change event within the worksheet object. Didn't test this
much, but should work for most scenarios. Note, it appends to any
formula that may be in the range of values your adjusting. Otherwise
it could be much simplier.
HTH,
Steve Hieb
|