ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Remove columns containing all zeros (https://www.excelbanter.com/excel-worksheet-functions/264991-remove-columns-containing-all-zeros.html)

Nora_GG

Remove columns containing all zeros
 
How can I create a macro or conditional formula to remove columns containing
all zeros

Max

Remove columns containing all zeros
 
A simple formula way to flag it, use COUNTIF
Eg in A1: =COUNTIF(A2:A5,0)=4
Copy across. Cols to be deleted will be TRUE
--
Max
Singapore
---
"Nora_GG" wrote:
How can I create a macro or conditional formula to remove columns containing
all zeros


Nora_GG[_2_]

Remove columns containing all zeros
 
Thanks Max. I was able to flag teh columns I need to remove. Do you know a
macro that can then delete columns containing "TRUE" as the header?

"Max" wrote:

A simple formula way to flag it, use COUNTIF
Eg in A1: =COUNTIF(A2:A5,0)=4
Copy across. Cols to be deleted will be TRUE
--
Max
Singapore
---
"Nora_GG" wrote:
How can I create a macro or conditional formula to remove columns containing
all zeros



All times are GMT +1. The time now is 10:29 PM.

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