Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default more help with a hide macro

Hello again,

I got some help with a hide macro for searching for a spcific word, and it
worked great. Now i'm trying to hide any row that has a 0 value in the b
column. if it is any other number. I want it to remain. I tried changing the
macro, but it hides everything and can't get it to work.

Any help would be greatly appreciated.

Thanks,

Aaron


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default more help with a hide macro

With only limited information:

set rng = Columns(2).SpecialCells(xlConstants,xlNumbers)
for each cell in rng
if cell.Value = 0 then
cell.EntireRow.Hidden = True
else
cell.Entirerow.Hidden = False
end if
Next

if the zeros are produce by formula, change xlconstants to xlFormulas

--
Regards,
Tom Ogilvy

"Awoll" wrote in message
...
Hello again,

I got some help with a hide macro for searching for a spcific word, and it
worked great. Now i'm trying to hide any row that has a 0 value in the b
column. if it is any other number. I want it to remain. I tried changing

the
macro, but it hides everything and can't get it to work.

Any help would be greatly appreciated.

Thanks,

Aaron




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default more help with a hide macro

Awsome, the zero are produced by a if function so i'm hoping that the
xlForumulas will work. Is there anyway to specify the worksheet that it runs
on?


"Tom Ogilvy" wrote in message
...
With only limited information:

set rng = Columns(2).SpecialCells(xlConstants,xlNumbers)
for each cell in rng
if cell.Value = 0 then
cell.EntireRow.Hidden = True
else
cell.Entirerow.Hidden = False
end if
Next

if the zeros are produce by formula, change xlconstants to xlFormulas

--
Regards,
Tom Ogilvy

"Awoll" wrote in message
...
Hello again,

I got some help with a hide macro for searching for a spcific word, and

it
worked great. Now i'm trying to hide any row that has a 0 value in the b
column. if it is any other number. I want it to remain. I tried changing

the
macro, but it hides everything and can't get it to work.

Any help would be greatly appreciated.

Thanks,

Aaron






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default more help with a hide macro

Dim rng as Range, cell as Range
With Worksheets("Sheet3")
set rng = .Columns(2).SpecialCells(xlFormulas,xlNumbers)
End With
for each cell in rng
if cell.Value = 0 then
cell.EntireRow.Hidden = True
else
cell.Entirerow.Hidden = False
end if
Next

--
Regards,
Tom Ogilvy

"Awoll" wrote in message
...
Awsome, the zero are produced by a if function so i'm hoping that the
xlForumulas will work. Is there anyway to specify the worksheet that it

runs
on?


"Tom Ogilvy" wrote in message
...
With only limited information:

set rng = Columns(2).SpecialCells(xlConstants,xlNumbers)
for each cell in rng
if cell.Value = 0 then
cell.EntireRow.Hidden = True
else
cell.Entirerow.Hidden = False
end if
Next

if the zeros are produce by formula, change xlconstants to xlFormulas

--
Regards,
Tom Ogilvy

"Awoll" wrote in message
...
Hello again,

I got some help with a hide macro for searching for a spcific word,

and
it
worked great. Now i'm trying to hide any row that has a 0 value in the

b
column. if it is any other number. I want it to remain. I tried

changing
the
macro, but it hides everything and can't get it to work.

Any help would be greatly appreciated.

Thanks,

Aaron








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide a Macro [email protected] Excel Discussion (Misc queries) 2 July 26th 07 09:12 AM
macro to hide row with 0.00 Lori Excel Worksheet Functions 2 April 25th 07 08:56 PM
macro to hide columns Shooter Excel Worksheet Functions 2 September 27th 05 09:04 PM
Macro to hide rows Jeffrey Marcellus Excel Programming 0 September 5th 03 07:09 PM
Hide/Unhide Macro bug Dave[_28_] Excel Programming 1 September 4th 03 06:26 PM


All times are GMT +1. The time now is 02:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"