Hi folks!
I have the following code which I don't want to have to copy 96 times for the 96 rows it affects. Can someone please help me condense it?
The code would have to apply to each row (from A16) to hide the row underneath it, if the said cell contains the text "/TP"
I'm assuming a loop would be the best option, but I've no idea how to write code for this.
I have the following code which I don't want to have to copy 96 times for the 96 rows it affects. Can someone please help me condense it?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Row_int As IntegerDim
Check_Rng As RangeDim
N_int As IntegerDim
Hide_row_int As Integer
Application.ScreenUpdating = False
Select Case Target.Address
Case "$A$16"
If Target.Value = "/TP" Then
Rows("17").Hidden = True
Else
Rows("17").Hidden = False
End If
End Select
Application.ScreenUpdating = True
End Sub
The code would have to apply to each row (from A16) to hide the row underneath it, if the said cell contains the text "/TP"
I'm assuming a loop would be the best option, but I've no idea how to write code for this.
Last edited: