ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional macro to hide rows (https://www.excelbanter.com/excel-programming/327912-conditional-macro-hide-rows.html)

Cher

Conditional macro to hide rows
 
I have a worksheet containing employee ID numbers and hours worked on each
job. I need help with a macro to hide all rows on the worksheet that have
zero hours for any job.

Bob Phillips[_6_]

Conditional macro to hide rows
 
Why not just filter on values < 0?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Rob" wrote in message
...
try:
with Range("your range")
for each cell in .columns(3) 'column within the range with the hours
if cell=0 then
cell.entirerow.hidden=true
else
cell.entirerow.hidden=false
end if
next
end with



"cher" wrote:

I have a worksheet containing employee ID numbers and hours worked on

each
job. I need help with a macro to hide all rows on the worksheet that

have
zero hours for any job.





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

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