Thread: Code Help
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bernard Liengme Bernard Liengme is offline
external usenet poster
 
Posts: 4,393
Default Code Help

This line: cell.Value = (cell.FormulaR1C1 = "=RC[-1]*(1+Amt),")
reads: cell.Value = (this = that) so it is not surprising the result is
either TRUE or FALSE


Sub Test()

Amt = InputBox("By What % (As Decimal)")

For Each J = 16 to 51
Cells(J, "F").Value = Cells( J , "E") *(1+ Amt)
Next J
,,,,


no time to test but I think you get the idea
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Ronbo" wrote in message
...
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