Error in simple code
HI, I am new to coding.
Kindly help me with the followinf error.
Sub Extraction()
Dim Lastrow As Long
Dim Sheetname As Worksheet
Lastrow = ActiveSheet.UsedRange.Rows.Count
For i = 1 To Lastrow
W = ActiveSheet.Cells(i, 1).Value
If W = "" Then
TempW = ActiveSheet.Cells(i, 2).Value
Else
GoTo STOPP
STOPP:
MsgBox (TempW)
Next i
End Sub
When i run it as a macro, it says that Next i without For.
Kindly help
|