Thanks for the reply.
I want to put the code in VB6 and not in the excel file The full code is like this
I want to trigger this code from VB6 and doesnot want to keep in the excel file.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 3 And Target.Row = 2 Then
Sheets("Statement").Rows.Hidden = False ' This is new line to unhide earlier rows
For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If (Cells(i, 3) = 0 And IsEmpty(Cells(i, 3)) = False) Or _
(Cells(i, 4) = 0 And IsEmpty(Cells(i, 4)) = False) Or _
(Cells(i, 5) = 0 And IsEmpty(Cells(i, 5)) = False) Then
Cells(i, 1).EntireRow.Hidden = True