Gingertrees
Well-known Member
- Joined
- Sep 21, 2009
- Messages
- 697
I have a spreadsheet where a "comment" section tends to have 100s of rows of trailing "#N/A"s. My initial thought was simply to filter on the comment column and delete those rows. But sometimes there is an #N/A in a row that has other useful info. To better explain:
<tbody>
</tbody>Since other columns in row 2 have info, I do not want to delete row 2 despite the error in the comment section. The last two rows, however, are useless and could be deleted.
Here is my code to delete #N/A in field 4 (comment). How do I change this to filter out ones where the other columns are NOT blank?
ID | Field2 | Field3 | Comment |
1 | cat | 123 | #N/A |
2 | dog | 3333 | Fido |
#N/A | |||
#N/A |
<tbody>
</tbody>
Here is my code to delete #N/A in field 4 (comment). How do I change this to filter out ones where the other columns are NOT blank?
Code:
FullrangeII.AutoFilter field:=4, Criteria1:="#N/A", Operator:=xlAnd
'//////Field 4=comments. Tweak as necessary.
ActiveSheet.Range("A3:EE" & LastRow).SpecialCells(xlCellTypeVisible).EntireRow.Delete
ActiveSheet.ShowAllData