i have the following code (thanks to an earlier post)that hides rows based on the value of cells in a specified column.
This works fine, but i now want to perfprm this on other sheets in the workbook, i have a list of the sheetnames of the sheeets i need to perform this on in sheet 1. how can i amend the code so that it will look at the list of sheet names and then run the hideRows macro on each of the named sheets?
Cheers, Craig
Si fractum non sit, noli id reficere
Code:
Sub hideRows()
Application.ScreenUpdating = False
Dim stratRow As Integer, endRow As Integer
Dim targetCol As String, x As Integer
startRow = 1
endRow = 200
targetCol = "hk"
For x = startRow To endRow
If Range(targetCol & x).Value = 0 Then
Range(targetCol & x).EntireRow.Hidden = True
End If
Next x
Application.ScreenUpdating = True
End Sub
Cheers, Craig
Si fractum non sit, noli id reficere