![]() |
Macro to hide rows
What is a good macro to hide rows in a table selected range that have "0"
values? Reason for wanting this if I filter any one column for values of "0" then it is likely to hide values in other columns that are not "0". I want to show all rows that have any value other than "0" in a selected range. Can you help me please? -- Thank you! |
Macro to hide rows
Doug,
Try this. Select a range and then run the code Sub Hide_Me() For Each c In Selection If c.Value < "" And c.Value = 0 Then c.EntireRow.Hidden = True End If Next End Sub Mike "Doug" wrote: What is a good macro to hide rows in a table selected range that have "0" values? Reason for wanting this if I filter any one column for values of "0" then it is likely to hide values in other columns that are not "0". I want to show all rows that have any value other than "0" in a selected range. Can you help me please? -- Thank you! |
Macro to hide rows
I think this is hiding a row if it has a single "0" value. I am needing it to
hide it if they are all "0" values. When I tried it, ran for about 1 minute and timed out after hiding about 40 rows at the top of my table. -- Thank you! "Mike H" wrote: Doug, Try this. Select a range and then run the code Sub Hide_Me() For Each c In Selection If c.Value < "" And c.Value = 0 Then c.EntireRow.Hidden = True End If Next End Sub Mike "Doug" wrote: What is a good macro to hide rows in a table selected range that have "0" values? Reason for wanting this if I filter any one column for values of "0" then it is likely to hide values in other columns that are not "0". I want to show all rows that have any value other than "0" in a selected range. Can you help me please? -- Thank you! |
Macro to hide rows
How about, instead of code, add a column with formula that resolves to True
if your condition is met, then just apply a filter? e.g. new column A, with formula in A2 "=or(b2<0,c2<0,d2<0,e2<0)" with arguments for as many cells to the right need to be tested for 0 value. "Doug" wrote: What is a good macro to hide rows in a table selected range that have "0" values? Reason for wanting this if I filter any one column for values of "0" then it is likely to hide values in other columns that are not "0". I want to show all rows that have any value other than "0" in a selected range. Can you help me please? -- Thank you! |
Macro to hide rows
Thank you
-- Thank you! "B Lynn B" wrote: How about, instead of code, add a column with formula that resolves to True if your condition is met, then just apply a filter? e.g. new column A, with formula in A2 "=or(b2<0,c2<0,d2<0,e2<0)" with arguments for as many cells to the right need to be tested for 0 value. "Doug" wrote: What is a good macro to hide rows in a table selected range that have "0" values? Reason for wanting this if I filter any one column for values of "0" then it is likely to hide values in other columns that are not "0". I want to show all rows that have any value other than "0" in a selected range. Can you help me please? -- Thank you! |
All times are GMT +1. The time now is 08:04 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com