Select and Delete Columns by colors

Copper Contributor


I have the problem that I have to delete from the second sheet (duplicate of the first), all the columns that instead have a value of 0, in any cell of the column.


These columns have no color fill, the others are red (no have 0)


I read discussion Robert1290 from 2021 but on MAC how I can activate VBA?


I don't have Alt and I don't have F11 and I've never used excel before


Can I use the same script written in the post?

How do I change the Red color to No Fill in the script?


I use Excel in Italian.


I can't find any other commands.


If there are other solutions please tell me!


Thank you

1 Reply


On a Mac, the function keys might not be labeled as "F1," "F2," etc. as they serve multiple purposes by default. However, you can still access the function keys by holding down the "Fn" key and pressing the corresponding key.

Regarding your query, using VBA on Excel for Mac is indeed different due to the absence of the VBA environment. Instead, I can guide you on how to achieve this without VBA, using Excel's functionalities directly.

Removing Columns with 0 Values and Color Differentiation:

  1. Filter and Delete Columns with 0:
    • Go to your sheet.
    • Select your data area.
    • Click on "Data" in the menu.
    • Choose "Filter" (or "Ordina e filtra" in Italian).
    • Filter by each column for "0" values and delete those columns manually.
  2. Removing Colored Columns:
    • For red-colored columns, use the "Find & Select" functionality.
    • Click on a column letter (like "A") to select the whole column.
    • Go to "Home" -> "Find & Select" -> "Find" (or "Trova" in Italian).
    • Select "Format" and choose the red fill color. Click "Find All."
    • Manually select the columns that are highlighted and delete them.

For a more automated solution, you might consider exploring Excel functions and array formulas. You could use the COUNTIF function to identify columns with all 0s and conditional formatting to identify colored cells, then manually delete or hide the columns based on those results.

Without VBA on Excel for Mac, these manual methods or formulas might be the best way to tackle this problem, although they may not be as streamlined as a VBA script.

The text was created with the help of AI.


My answers are voluntary and without guarantee!


Hope this will help you.


Was the answer useful? Mark as best response and like it!

This will help all forum participants.