K
khurram_razaq
Hi,
I am trying to create a code to run on a workbook with several work sheets
to hide rows with zero values.
I have used the following code:
Sub HideRowsIfColumnDisEmpty()
Dim X As Long
Dim LastRowOfData As Long
With Worksheets("Functional SummaryTotal Risk")
LastRowOfData = .Cells(.Rows.Count, "N").End(xlUp).Row
For X = 1 To LastRowOfData
If .Cells(X, "N").Value = 0 Then
.Cells(X, "N").EntireRow.Hidden = True
End If
Next
End With
End Sub
This works for one worksheet in a workbook, however I need this to work on
multiple sheets.
Could someone please help me on how I can modify this could so that it can
run successfully on multipule worksheets in a workbook.
Thank you.
Khurram
I am trying to create a code to run on a workbook with several work sheets
to hide rows with zero values.
I have used the following code:
Sub HideRowsIfColumnDisEmpty()
Dim X As Long
Dim LastRowOfData As Long
With Worksheets("Functional SummaryTotal Risk")
LastRowOfData = .Cells(.Rows.Count, "N").End(xlUp).Row
For X = 1 To LastRowOfData
If .Cells(X, "N").Value = 0 Then
.Cells(X, "N").EntireRow.Hidden = True
End If
Next
End With
End Sub
This works for one worksheet in a workbook, however I need this to work on
multiple sheets.
Could someone please help me on how I can modify this could so that it can
run successfully on multipule worksheets in a workbook.
Thank you.
Khurram