Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide rows based on a condition

I have very little expierence with writing VB and what I would like to do is
based on a condition in cell "A1" being Y hide rows 15 - 20. "A2" hide rows
25 - 30 else do nothing.

Any help would be greatly appreciated.

Kim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Hide rows based on a condition

try

If UCase(Range("a1")) = "Y" Then Rows("10:15").Hidden = True
If UCase(Range("a2")) = "Y" Then Rows("25:30").Hidden = True

--
Don Guillett
SalesAid Software

"KimberlyH" wrote in message
...
I have very little expierence with writing VB and what I would like to do
is
based on a condition in cell "A1" being Y hide rows 15 - 20. "A2" hide
rows
25 - 30 else do nothing.

Any help would be greatly appreciated.

Kim



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Hide rows based on a condition

Hi KimberlyH

You can test this event in the sheet module

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("A1:A2"), Target) Is Nothing Then
Rows("15:30").Hidden = False
If LCase(Range("A1").Value) = "y" Then Rows("15:20").Hidden = True
If LCase(Range("A2").Value) = "y" Then Rows("25:30").Hidden = True
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"KimberlyH" wrote in message ...
I have very little expierence with writing VB and what I would like to do is
based on a condition in cell "A1" being Y hide rows 15 - 20. "A2" hide rows
25 - 30 else do nothing.

Any help would be greatly appreciated.

Kim



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 Rows If Condition True wilbursj Excel Worksheet Functions 2 April 20th 09 08:09 PM
hide rows where cell condition is not met amaries Excel Worksheet Functions 1 January 9th 07 06:50 PM
Hide a row based on one cell's condition Brian Excel Worksheet Functions 1 March 19th 05 11:57 AM
how to hide section of worksheet based on a condition (e.g. tick . kitepuppet Excel Discussion (Misc queries) 2 March 4th 05 06:30 PM
How do I hide a column based on a condition (option not available. jgentillet Excel Worksheet Functions 0 January 24th 05 02:53 PM


All times are GMT +1. The time now is 11:29 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"