Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 49926

[SOLVED] compile error else without if

$
0
0
working on the fallowing code and i keep getting the fallowing error compile error else without if but i have the if in there any ideas
Code:

Sub converted():
Dim t As Integer
Dim y As Integer
Dim z As Integer
t = Sheets("Data").Range("w1").Value
y = 2

If Sheets("Data").Cells(y, 20).Value = "x" Then
    Do While y < t
    Sheets("Data").Range("Y,20").EntireRow.Cut _
    Sheets("NO ppp").Range("a" & Rows.Count).End(xlUp).Offset(1, 0)
    Rows(ActiveCell.Row).deletexlshiftup
Else: y = y + 1
 
End If
End Sub

thanks for the help

Viewing all articles
Browse latest Browse all 49926

Trending Articles