Hello, very new to VBA so apologies if this is a very simple answer! I have an excel sheet (made by someone else) that runs a macro that gives a new row a number and creates a new worksheet with the same number as you'll see in the image. In column J the 'Status' column there's a drop down list where you can choose a few different options. I'm trying to make a script (by fudging together other peoples examples online) that when the status is 'Closed' the whole row hides but it also hides the worksheet with the associated number. So far i've had no luck, i've tried removing the worksheet part and just focusing on hiding the rows but i can't even get that any help would be greatly appreciated.
VBA Code:
Sub worksheet_change(ByVal target As Range)
Set target = Range("J5:J10")
If target.Text = "Closed" Then
Dim i As Integer
For i = 5 To 10
If Cells(10, i).Text = "Closed" Then
Cells(10, i).EntireRow.Hidden = True
Else
Cells(10, i).EntireRow.Hidden = False
End If
Next i
End If
Dim wkSht As Worksheet
For Each wkSht In Sheets
For Each Cell In Sheets("Issue List").Range("A5:A10")
If Rows("5:10").EntireRow.Hidden = True & Cell.Value = wkSht.Name Then
wkSht.Hidden = True
End If
Next Cell
Next wkSht
End Sub