BABAR RASHEE
03-13-2008, 04:10 AM
Dear All
i tried to use this code and help me to hide the rows with Zero values base on the Col Q. but there is one problem. i have some thing like 15 worksheet, and i make the 15 macros in all sheets. i just want to have a one code for all 15 sheet. means when i run the macros i should have one macros code and once i run it should work for all my sheets.
Thaks
Sub HideRowIfZeroInQ()
Dim R As Range
Dim LastRow As Long
LastRow = Cells(Rows.Count, "Q").End(xlUp).Row
If LastRow > 2800 Then LastRow = 2800
For Each R In Range("Q8:q" & CStr(LastRow))
If R.Value = 0 And R.Value <> "Q" Then R.EntireRow.Hidden = True
Next
End Sub
i tried to use this code and help me to hide the rows with Zero values base on the Col Q. but there is one problem. i have some thing like 15 worksheet, and i make the 15 macros in all sheets. i just want to have a one code for all 15 sheet. means when i run the macros i should have one macros code and once i run it should work for all my sheets.
Thaks
Sub HideRowIfZeroInQ()
Dim R As Range
Dim LastRow As Long
LastRow = Cells(Rows.Count, "Q").End(xlUp).Row
If LastRow > 2800 Then LastRow = 2800
For Each R In Range("Q8:q" & CStr(LastRow))
If R.Value = 0 And R.Value <> "Q" Then R.EntireRow.Hidden = True
Next
End Sub