Code Help
It still gives me "False" in each cell.
"OssieMac" wrote:
Hi Ronbo,
I prefer to use cel in lieu of cell so as not to be confused with reserved
words.
Option Explicit
Dim rng As Range
Dim lastrow As Long
Dim cel As Range
Dim Amt As Double
Sub Test()
Amt = InputBox("By What % (As Decimal)")
Set rng = Range("f16:f51")
For Each cel In rng
cel.FormulaR1C1 = "=RC[-1]*(1+" & Amt & ")"
Next cel
End Sub
--
Regards,
OssieMac
"Ronbo" wrote:
I have the following code that I need to take a range (f16..f51) and
increase/decrease it by a user input value i.e. f16=e16*(1+user input)
Option Explicit
Dim rng As Range
Dim lastrow As Long
Dim cell As Range
Dim Amt As Double
Sub Test()
Amt = InputBox("By What % (As Decimal)")
Set rng = Range("f16:f51")
For Each cell In rng
cell.Value = (cell.FormulaR1C1 = "=RC[-1]*(1+Amt),")
I get "FALSE" in each cell. What am I doing wrong?
Ronbo
|