La if else potresti sostituirla con

riga.Cells(e.ColumnIndex).Value = Not riga.Cells(e.ColumnIndex).Value