I checked the search function, but could not find any answer to my issue.
What I want is VBA to check a specific range for 200+ rows whether these are entirely empty and if so, to delete these and shift up cells.
Sub delete_empty_cells2() 
    Dim k As Integer 
    Dim r As Range
    For k = 4 To 260 
        Set r = Range("AAk:AFk") 
        If r.Value = "" Then
            r.Select 
            Selection.SpecialCells(xlCellTypeBlanks).Select
            Selection.Delete Shift:=xlUp 
        End If 
    Next k
End Sub
Now obviously, the code is wrong. I'm not really used to VBA yet and don't know all commands / objects. Is there a way to tell VBA that the range is variable (it should check all ranges, e.g. starting by checking AA4:AF4).
Thanks in advance!
Zahbi