I have been trying to use some snippets on how to delete entire rows on Excel VBA, but I can't modify them to include the "IsNumber" verification.
I need to be able to choose an active area, like:
Set r = ActiveSheet.Range("A1:C10")
And as it goes through row after row (and checking every cell of the area), delete the entire row if a there is a number on a cell.
For example:
NA NA NA 21
NA 22 NA 44
00 NA NA NA
NA NA NA NA
55 NA NA NA
The macro would then delete all the rows, except for the 4th one which is
NA NA NA NA
Take your pick :)
WAY 1 (TRIED AND TESTED)
This uses
SpecialCells
to identify the rows which has numbers.WAY 2 (TRIED AND TESTED)
This uses Looping and
Count()
to check for numbersWay 3 (TRIED AND TESTED)
This uses Auto Filters. I am assuming that row 1 has headers and there is no blank cell in your range.
Not try but easy code to understand delete and IsNumeric test.