graduate106
Board Regular
- Joined
- Jul 14, 2011
- Messages
- 91
I'm a bit of a newby when it comes to macros so excuse my ignorance!
I have the following macro which i found online somewhere which basically hides and shows rows/columns based on whether a box has a 0 in it. The problem is, the macro fires every time a cell is changed on the worksheet which is getting a bit tedious. I only want it to fire when say cells XX to XX are changed.
Im sure this will be easy amended to allow this - can someone help please?
Many thanks in advance
Here is my current macro:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Dim ACell As Range
For Each ACell In Range("j10:j20")
If ACell.Value = 0 Then
ACell.EntireRow.Hidden = True
Else
ACell.EntireRow.Hidden = False
End If
Next ACell
Application.ScreenUpdating = True
End Sub
I have the following macro which i found online somewhere which basically hides and shows rows/columns based on whether a box has a 0 in it. The problem is, the macro fires every time a cell is changed on the worksheet which is getting a bit tedious. I only want it to fire when say cells XX to XX are changed.
Im sure this will be easy amended to allow this - can someone help please?
Many thanks in advance
Here is my current macro:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Dim ACell As Range
For Each ACell In Range("j10:j20")
If ACell.Value = 0 Then
ACell.EntireRow.Hidden = True
Else
ACell.EntireRow.Hidden = False
End If
Next ACell
Application.ScreenUpdating = True
End Sub