How to Hide Rows with Zero Value in Excel (VBA)

This post will guide you how to hide rows with zero values in the selected range with VBA Macro in Excel. How do I hide rows which contain zero value in Excel.

Hide Rows with Zero Value


Assuming that you have a list of data in range A1:C5, in which contain sale values. And you want to hide rows if any of the cells in Column C are equal to zero. How to do it. You can use an Excel VBA Macro to quickly achieve the result of hiding rows with zero value. Just do the following steps:

#1 open your excel workbook and then click on “Visual Basic” command under DEVELOPER Tab, or just press “ALT+F11” shortcut.

Get the position of the nth using excel vba1

#2 then the “Visual Basic Editor” window will appear.

#3 click “Insert” ->”Module” to create a new module.

convert column number to letter3

#4 paste the below VBA code  into the code window. Then clicking “Save” button.

hide rows with zero value1

#5 back to the current worksheet, then run the above excel macro. Click Run button.

hide rows with zero value2

#6 select one range that you want to hide rows, such as: A1:C5.

hide rows with zero value3

#7 Let’s see the last result:

hide rows with zero value4

You might also like:

Comments

So empty here ... leave a comment!

Leave a Reply

Your email address will not be published. Required fields are marked *

Sidebar