ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Delete rows that are empty across columns (https://www.excelbanter.com/excel-worksheet-functions/117589-delete-rows-empty-across-columns.html)

ALATL

Delete rows that are empty across columns
 
I have the following columns that are a result of a pivot table. I would like
to delete the folllowing occurences. I tried using the range function but got
a runtime error 1004. Something like:

' If Not Range("Col1").Value Is Nothing Then
' Rows.Delete

Col1 Col2
a a b
X X X
X (delete)
X X
X X
X (delete)

I want to delete rows where Col1 = X and Col2 = X does not exist. To
complicate things, this is a pivot table where Col1 and Col2 are further
broken down into a and b. I thought that by using Range that a and b would
not need to be accounted for individually. Thanks for any help!


All times are GMT +1. The time now is 12:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com