I am getting error code 1004 on the do while line in the following code. However, when run I do get the message "It is not blank." The conditions are the same for both the if statement and while statement, so I don't understand why I am getting an error. What am i missing?

    'clear existing data
    rowindex = Main_Row_FirstDataRow
    
    If Not Sheets("Main").Range(Main_Column_DXFCoordX & rowindex).Value = "" Then
        MsgBox "It is not blank"
    End If
    
    'I get an error on the following line
    Do While Not Sheets("Main").Range(Main_Column_DXFCoordX & rowindex).Value = ""
        rowindex = rowindex = 1
    Loop