SAMCRO2014
Board Regular
- Joined
- Sep 3, 2015
- Messages
- 160
I am trying to get a loop to return a value (Previous or Current) when looking through a column. My coding is returning "Previous" when it should be "Current" and vice versa. Also, I am trying to get it to return a value (Current) if a string of text in a cell contains the word "Error".
So if the cell :
contains the word "Error" in it =Current
value is > 201814 = Current
all other cells =Previous
This is what I have
For f = 2 To LastRowData
If Cells(f, 12).Value = "*Error*" Then
Cells(f, 13) = "Current"
ElseIf Cells(f, 12).Value > "201814" Then
Cells(f, 13) = "Current"
Else: Cells(f, 13) = "Previous"
End If
Next f
Thanks!
So if the cell :
contains the word "Error" in it =Current
value is > 201814 = Current
all other cells =Previous
This is what I have
For f = 2 To LastRowData
If Cells(f, 12).Value = "*Error*" Then
Cells(f, 13) = "Current"
ElseIf Cells(f, 12).Value > "201814" Then
Cells(f, 13) = "Current"
Else: Cells(f, 13) = "Previous"
End If
Next f
Thanks!