Option Explicit
Sub test()
Dim l As Long
For l = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If Cells(l, 1).Value = "x" Then Rows(l).Delete
Next l
For l = Cells(1, Columns.Count).End(xlToLeft).Row To 1 Step -1
If Cells(1, l).Value = "x" Then Columns(l).Delete
Next l
End Sub