+ Reply to Thread
Results 1 to 2 of 2

[SOLVED] Hide Rows if cell value is

  1. #1
    mohd21uk via OfficeKB.com
    Guest

    [SOLVED] Hide Rows if cell value is

    I would like to hide a row if certain values are entered in three cells. For
    e.g. if United Kingdom is selected in Cell C3 and C5 and CI is selected from
    cell C10, I would then have Row 16 hidden. I would like this to be
    dynamically i.e. updated whenever the value in the cell changes.

    Many thanks in advance.

    --
    Message posted via OfficeKB.com
    http://www.officekb.com/Uwe/Forums.a...l-new/200605/1

  2. #2
    Norman Jones
    Guest

    Re: Hide Rows if cell value is

    Hi Mohd,

    Try:

    '=============>>
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rng As Range

    Set rng = Me.Range("C3,C5,C10")

    If Not Intersect(rng, Target) Is Nothing Then
    Rows(16).EntireRow.Hidden = Range("C3").Value = _
    "United Kingdom" And Range("C5").Value = _
    "United Kingdom" And Range("C10") = "C1"
    End If
    End Sub
    '<<=============

    This is worksheet event code and should be pasted into the worksheets's code
    module (not a standard module and not the workbook's ThisWorkbook module):

    Right-click the worksheet's tab
    Select 'View Code' from the menu and paste the code.
    Alt-F11 to return to Excel.


    ---
    Regards,
    Norman



    "mohd21uk via OfficeKB.com" <u20517@uwe> wrote in message
    news:6056580dee09e@uwe...
    >I would like to hide a row if certain values are entered in three cells.
    >For
    > e.g. if United Kingdom is selected in Cell C3 and C5 and CI is selected
    > from
    > cell C10, I would then have Row 16 hidden. I would like this to be
    > dynamically i.e. updated whenever the value in the cell changes.
    >
    > Many thanks in advance.
    >
    > --
    > Message posted via OfficeKB.com
    > http://www.officekb.com/Uwe/Forums.a...l-new/200605/1




+ 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