NeedyHelpExcelMan
New Member
- Joined
- Jun 25, 2014
- Messages
- 17
Hello all,
So I am trying to have a bit of code that recognizes all values between 3 and 5 within a range (which I will refer to as n) and if a cell value falls within this range then apply the replace the value with the following formula (n[original val] - 3) x .5) +3
Below is the code I have thus far to recognize all values between 3 and 5 but I'm having trouble defining the values - not sure whether to dim a range or something else?
Thanks in advance
So I am trying to have a bit of code that recognizes all values between 3 and 5 within a range (which I will refer to as n) and if a cell value falls within this range then apply the replace the value with the following formula (n[original val] - 3) x .5) +3
Below is the code I have thus far to recognize all values between 3 and 5 but I'm having trouble defining the values - not sure whether to dim a range or something else?
Thanks in advance
Code:
For Each Cel In Range(Range("E1").End(xlDown).End(xlDown), Range("E" & Rows.Count))
If Cel.value is >= 3 & <= 5 Then Cel.Offset(0, 0).Value = ((Cel.value - 3)*.5)+3
Next