View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default automate hide row

My code is designed to run when you enter the value. So you would change H:H
to B:K and then set a value.

--
__________________________________
HTH

Bob

"Nicole" wrote in message
...
Hi Bob,

I have paste the below string into the view code page, nothing
happens, should i click something after pasting and close the view
code page? Let me show a simple example:
Fruit Jan Feb Mar
A 1 1 1
B 2 3 1
C 0 0 0
D 1 1 1

Altogether I have col A to K and row 3 to 400, i want to hide row like
C above automatically

Nicole
On Dec 18, 4:52 pm, "Bob Phillips" wrote:
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H:H" '<=== change to suit

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then

With Target

Me.Rows(.Row).Hidden = .Value = 0
End With
End If
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--
__________________________________
HTH

Bob

"Nicole" wrote in message

...



Is there a formula i can set toautomatehiding arowwhen a
particular cell returns a zero value?-Hidequoted text -


- Show quoted text -