Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Hiding rows based on a criteria thru and event proceedure

On Sep 6, 2:42 pm, Zoltan wrote:
Hello,

try this:

Private Sub CommandButton1_Click()

Dim mycell As Range
Dim rng As Range

Set rng = Range("L5:L100")
For Each mycell In rng
If mycell.Value = 0 Then
Rows(mycell.Row).Hidden = True
End If
Next

End Sub

It goes thru the range and check each cell. If cell value is 0, then it
hides that specific row.
I hope I understood well your question.

Regards,
Zoltan

"realmani" wrote:

I have data range L5:L100 which contains numbers. I want an event
proceedure which hide the rows if cell value is equal to zero.


Further i want this event proceedure assign to a button. Clicking on
it will perform the above task


Could anyone help?


Thank you very much Zoltan!!!! that works perfectly

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
Hiding Specific Rows Based on Values in Other Rows Chris Excel Worksheet Functions 1 November 2nd 06 08:21 PM
hiding rows based on cell contents Jason M Excel Discussion (Misc queries) 1 October 30th 06 04:30 PM
Hiding rows based on a value John Excel Discussion (Misc queries) 1 July 2nd 05 08:44 PM
Hiding Rows Based on Percentile Jonny Excel Discussion (Misc queries) 1 March 31st 05 01:10 PM
Hiding rows based on date Steve Excel Worksheet Functions 2 November 1st 04 02:30 PM


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

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

About Us

"It's about Microsoft Excel"