I have a sheet, that has 2 columns and 36 rows. Macro should do these things: 1) if cell in row 1, column 1 are not empty and cell in row 1, column 2 is empty macro should stop, else it should continue and after checking all 36 rows it should stop and do SaveAs, if no such values are found. I found this code and modified a little bit, but it doesn't work as I described:
Sub CheckRows()
Dim i As Long
For i = 12 To 47
'Criteria search
If Sheets("Claims").Cells(i, 2).Value <> "" Then
If Sheets("Claims").Cells(i, 3).Value = "" Then
Exit Sub
Else
End If
End If
Next i
ActiveWorkbook.SaveAs Filename:="myFile.xlsx", FileFormat:=56
End Sub
Could anyone help me out and tell what's wrong with the code? Thanks