I try to run a code when column "L" and column "V" stated "Completed" on both. Then column "W" will show "Completed" else it will show "incompleted" but it show compile error "Else withou if".
Below is my code
Sub OverallStatus()
Dim x As Long
Dim lastrow As Long
With Sheet1
If Application.WorksheetFunction.CountA(.Cells) <> 0 Then
lastrow = .Cells.Find(What:="*", _
After:=.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
Else
lastrow = 1
End If
For x = 2 To lastrow
If .Range("L" & x) = "Completed" And .Range("V" & x) = "Completed" Then
.Range("W" & x) = "Completed"
Else: .Range("W" & x) = "Incomplete"
End If
Next
End With
End Sub