I have an Excel table with data in columns A:Y. Columns A:G will always contain values, while columns H:Y MAY NOT contain values. I would like to 1) sort my table based on based on column "H" which will move the rows containing blanks to the bottom, and then 2) delete only those rows which do not contain data in columns H:Y.
The data table will be ever changing and growing, so static variables are not truly an option.
Table.Sort.SortFields.Add2 Key:=Table.Range("H3"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With Table.Sort
.SetRange Table.Range("A3:Y3" & LastRow)
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
With Tab
LastRowB = .Range("H" & .Rows.Count).End(xlUp).Row + 1
End With
Tabs.Rows(LastRowB).End(xlDown).Select
Selection.Clear