Reputation: 95
I have an excel sheet (in a macros enabled excel file) that gets its data from other sheets. If there is no data to be shown, the cell would be empty (""). But the formula will still be there of course. Let's say SheetB gets data from SheetA, the formula in a cell on SheetB looks like this:
=IF(SheetA!A2="","","data")
So when I export/convert the sheet as a CSV, all the rows with no data but formula also get exported. I tried copy pasting the contents of SheetB into SheetC as values. I hoped that would get rid of the formulae. Even when there's no formulae there's still some information in the cells which causes them to get exported.
The only thing that works for me right now is to manually select and delete all the cells with no data but only formula. But it's time consuming as I have to do that to many files. And the number of rows with data differs from file to file. That's why I can't have a macro to delete rows after a specified row.
I've tried searching for solution for over 3 hours. I couldn't find anything. I'm sorry for the noob question.
Upvotes: 0
Views: 113
Reputation: 11978
Use a helper column and calculate the LEN of that cell. If it's 0, it means is blank (even if there is a formula inside, it will return 0). Then you can filter, and export to csv only those rows where LEN is not 0
Upvotes: 1