+ Reply to Thread
Results 1 to 5 of 5

Hide/unhide

  1. #1
    Jock W
    Guest

    Hide/unhide

    Using an 'If' function, is it possible to hide a row when criteria aren't met?
    --
    Jock Waddington

  2. #2
    Norman Jones
    Guest

    Re: Hide/unhide

    Hi Jock,

    It would be necessary to use VBA.

    If this is acceptable, post back with details of the range and the hide
    condition.

    ---
    Regards,
    Norman



    "Jock W" <[email protected]> wrote in message
    news:[email protected]...
    > Using an 'If' function, is it possible to hide a row when criteria aren't
    > met?
    > --
    > Jock Waddington




  3. #3
    Jock W
    Guest

    Re: Hide/unhide

    Norman,
    Here's an example of what I'd like to happen. If it's going to be hugely
    complex, then I can live without it!

    If (A15="xxxx",hide the next 4 rows,don't hide the next 4 rows)

    thanks,
    --
    Jock Waddington


    "Norman Jones" wrote:

    > Hi Jock,
    >
    > It would be necessary to use VBA.
    >
    > If this is acceptable, post back with details of the range and the hide
    > condition.
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "Jock W" <[email protected]> wrote in message
    > news:[email protected]...
    > > Using an 'If' function, is it possible to hide a row when criteria aren't
    > > met?
    > > --
    > > Jock Waddington

    >
    >
    >


  4. #4
    Norman Jones
    Guest

    Re: Hide/unhide

    Hi Jock,

    '======================>>
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rng As Range
    Const TestString As String = "xxxx" '<<===== CHANGE

    Set rng = Range("A15")

    If Not Intersect(rng, Target) Is Nothing Then
    Rows("16:20").Hidden = StrComp(rng.Value, TestString, _
    vbTextCompare) = 0
    End If

    End Sub
    '<<======================

    (1) Copy the above code
    (2) Right-click the worksheet tab
    (3) Paste the copied code
    (4) Alt-F11 to return to Excel

    All done!

    Now try entering: xxxx or XXXX in A15. This should hide rows, 16-20.
    Deleting, or changing A15 should restore rows 16:20 to view.


    ---
    Regards,
    Norman



    "Jock W" <[email protected]> wrote in message
    news:[email protected]...
    > Norman,
    > Here's an example of what I'd like to happen. If it's going to be hugely
    > complex, then I can live without it!
    >
    > If (A15="xxxx",hide the next 4 rows,don't hide the next 4 rows)
    >
    > thanks,
    > --
    > Jock Waddington
    >
    >
    > "Norman Jones" wrote:
    >
    >> Hi Jock,
    >>
    >> It would be necessary to use VBA.
    >>
    >> If this is acceptable, post back with details of the range and the hide
    >> condition.
    >>
    >> ---
    >> Regards,
    >> Norman
    >>
    >>
    >>
    >> "Jock W" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Using an 'If' function, is it possible to hide a row when criteria
    >> > aren't
    >> > met?
    >> > --
    >> > Jock Waddington

    >>
    >>
    >>




  5. #5
    Jock W
    Guest

    Re: Hide/unhide

    Thanks Norman. That's got it.

    Cheers
    --
    Jock Waddington


    "Norman Jones" wrote:

    > Hi Jock,
    >
    > '======================>>
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > Dim rng As Range
    > Const TestString As String = "xxxx" '<<===== CHANGE
    >
    > Set rng = Range("A15")
    >
    > If Not Intersect(rng, Target) Is Nothing Then
    > Rows("16:20").Hidden = StrComp(rng.Value, TestString, _
    > vbTextCompare) = 0
    > End If
    >
    > End Sub
    > '<<======================
    >
    > (1) Copy the above code
    > (2) Right-click the worksheet tab
    > (3) Paste the copied code
    > (4) Alt-F11 to return to Excel
    >
    > All done!
    >
    > Now try entering: xxxx or XXXX in A15. This should hide rows, 16-20.
    > Deleting, or changing A15 should restore rows 16:20 to view.
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "Jock W" <[email protected]> wrote in message
    > news:[email protected]...
    > > Norman,
    > > Here's an example of what I'd like to happen. If it's going to be hugely
    > > complex, then I can live without it!
    > >
    > > If (A15="xxxx",hide the next 4 rows,don't hide the next 4 rows)
    > >
    > > thanks,
    > > --
    > > Jock Waddington
    > >
    > >
    > > "Norman Jones" wrote:
    > >
    > >> Hi Jock,
    > >>
    > >> It would be necessary to use VBA.
    > >>
    > >> If this is acceptable, post back with details of the range and the hide
    > >> condition.
    > >>
    > >> ---
    > >> Regards,
    > >> Norman
    > >>
    > >>
    > >>
    > >> "Jock W" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > Using an 'If' function, is it possible to hide a row when criteria
    > >> > aren't
    > >> > met?
    > >> > --
    > >> > Jock Waddington
    > >>
    > >>
    > >>

    >
    >
    >


+ 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