#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 61
Default Hide Cells

Is there a macro or formula I can use to hide certain rows if certain cells
say "OK"?

For example, Hide any Rows between 78 and 131 when column T in those rows
equals "OK", all other rows in that range will remain visible.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 896
Default Hide Cells

Sub cus()

For i = 78 To 131
If Range("C" & i) = "OK" Then
Range("C" & i).Rows.EntireRow.Hidden = True
End If
Next i

End Sub


On 22 Maj, 14:39, lightbulb
wrote:
Is there a macro or formula I can use to hide certain rows if certain cells
say "OK"?

For example, Hide any Rows between 78 and 131 when column T in those rows
equals "OK", all other rows in that range will remain visible.

Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 61
Default Hide Cells

I selected view code by right clicking on the tab name, and pasted in the
code below, but nothing happened...it's been awhile since I've worked with
Macros, is there something else I have to do?



"Jarek Kujawa" wrote:

Sub cus()

For i = 78 To 131
If Range("C" & i) = "OK" Then
Range("C" & i).Rows.EntireRow.Hidden = True
End If
Next i

End Sub


On 22 Maj, 14:39, lightbulb
wrote:
Is there a macro or formula I can use to hide certain rows if certain cells
say "OK"?

For example, Hide any Rows between 78 and 131 when column T in those rows
equals "OK", all other rows in that range will remain visible.

Thanks!



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 896
Default Hide Cells

press ALT+F11 to get to VBA
then Insert-Module
paste the code
click Run


On 22 Maj, 16:25, lightbulb
wrote:
I selected view code by right clicking on the tab name, and pasted in the
code below, but nothing happened...it's been awhile since I've worked with
Macros, is there something else I have to do?



"Jarek Kujawa" wrote:
Sub cus()


Â* Â* For i = 78 To 131
Â* Â* Â* Â* If Range("C" & i) = "OK" Then
Â* Â* Â* Â* Â* Â* Range("C" & i).Rows.EntireRow..Hidden = True
Â* Â* Â* Â* End If
Â* Â* Next i


End Sub


On 22 Maj, 14:39, lightbulb
wrote:
Is there a macro or formula I can use to hide certain rows if certain cells
say "OK"?


For example, Hide any Rows between 78 and 131 when column T in those rows
equals "OK", all other rows in that range will remain visible.


Thanks!- Ukryj cytowany tekst -


- Pokaż cytowany tekst -


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 cells [email protected] Excel Discussion (Misc queries) 2 September 12th 08 10:01 PM
Hide cells Fred Goldman Excel Discussion (Misc queries) 9 November 27th 07 09:41 PM
Hide cells Daniel- Sydney Excel Discussion (Misc queries) 6 January 26th 07 05:14 PM
Want to show/hide cells depending on other cells results Marco Excel Discussion (Misc queries) 0 August 15th 06 06:21 PM
Cannot hide cells craig New Users to Excel 7 May 9th 05 10:11 PM


All times are GMT +1. The time now is 09:30 AM.

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"