ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Auto-Hide Rows Macro (https://www.excelbanter.com/excel-worksheet-functions/199599-auto-hide-rows-macro.html)

txtstorer

Auto-Hide Rows Macro
 
Is it possible to auto hide/unhide rows based on a vlaue that may/may not be
present?

For example, instead of writing many different macros, I would like a macro
to check say column A, and hide every row that has "n/a" as a value in column
A. The values in column A would be based on If Then statements, so they
would change to/from "n/a" depending upon other variables. I would like for
the macroo to continue to monitor and auto hide/unhide actively depending
upon that "n/a" value being present in column A

Any suggestions?

Thank you in advance!

Jarek Kujawa[_2_]

Auto-Hide Rows Macro
 
select yr data and use this macro

Sub hideem()
For Each cell in Selection
If cell.Value = "n/a" Then
cell.Rows.Entirerow.Hidden = True
End if
Next cell
End Sub


All times are GMT +1. The time now is 03:27 PM.

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