+ Reply to Thread
Results 1 to 3 of 3

Hide rows based on a condition

  1. #1
    KimberlyH
    Guest

    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. #2
    Don Guillett
    Guest

    Re: 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
    [email protected]
    "KimberlyH" <[email protected]> wrote in message
    news:[email protected]...
    >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. #3
    Ron de Bruin
    Guest

    Re: 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" <[email protected]> wrote in message news:[email protected]...
    >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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1