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
www.officekb.com/Uwe/Forums.a...l-new/200605/1
Hi Mohd,
Try:
'=============gt;gt;
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = Me.Range(quot;C3,C5,C10quot;)
If Not Intersect(rng, Target) Is Nothing Then
Rows(16).EntireRow.Hidden = Range(quot;C3quot;).Value = _
quot;United Kingdomquot; And Range(quot;C5quot;).Value = _
quot;United Kingdomquot; And Range(quot;C10quot;) = quot;C1quot;
End If
End Sub
'lt;lt;=============
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
quot;mohd21uk via OfficeKB.comquot; lt;u20517@uwegt; wrote in message
news:6056580dee09e@uwe...
gt;I would like to hide a row if certain values are entered in three cells.
gt;For
gt; e.g. if United Kingdom is selected in Cell C3 and C5 and CI is selected
gt; from
gt; cell C10, I would then have Row 16 hidden. I would like this to be
gt; dynamically i.e. updated whenever the value in the cell changes.
gt;
gt; Many thanks in advance.
gt;
gt; --
gt; Message posted via OfficeKB.com
gt; www.officekb.com/Uwe/Forums.a...l-new/200605/1
- Nov 03 Mon 2008 20:47
Hide Rows if cell value is
close
全站熱搜
留言列表
發表留言
留言列表

