Godders199
Active Member
- Joined
- Mar 2, 2017
- Messages
- 313
- Office Version
- 2013
Hello, I have been using the following code to calculate annual targets,
'Rolling Target'
Dim Addvalues
If Cells(i, 6).Value >= 1 Then
Addvalues = Range("p" & i).Value + Range("s" & i).Value + Range("v" & i).Value + Range("y" & i).Value
Range("ab" & i).Value = Addvalues + IIf(Cells(i, 6) <= 8, Range("f" & i).Value, Sheets("Homepage").Range("o4").Value)
Else
Cells(i, 28).Value = 0
End If
The value of o4 is 8
However i need to add some extra critiera based on the value in column Z
if z <= 3 then it needs to use the value 2 instead of O4
if z 4-6 then it needs to use the value 4 instead of O4
if z 7-9 then it needs to use th value 6 instead of o4
Does anyone know how to alter the code to reflect this.?
'Rolling Target'
Dim Addvalues
If Cells(i, 6).Value >= 1 Then
Addvalues = Range("p" & i).Value + Range("s" & i).Value + Range("v" & i).Value + Range("y" & i).Value
Range("ab" & i).Value = Addvalues + IIf(Cells(i, 6) <= 8, Range("f" & i).Value, Sheets("Homepage").Range("o4").Value)
Else
Cells(i, 28).Value = 0
End If
The value of o4 is 8
However i need to add some extra critiera based on the value in column Z
if z <= 3 then it needs to use the value 2 instead of O4
if z 4-6 then it needs to use the value 4 instead of O4
if z 7-9 then it needs to use th value 6 instead of o4
Does anyone know how to alter the code to reflect this.?