The macro below was originally 2 separate macros, one to hide rows and one to hide columns. I combined them into the one below, but I was wondering if it should be written in a better way.
Also, I use this same code in 7 other sheets where I just change the row and columns numbers. I made a macro to run all of them sequentially (see below also) but only the first one runs. Is there something in the code that terminates it? Thanks
Sub CLUTCH_BUILD_HIDE_ALL()
Dim xRg As Long
Application.ScreenUpdating = False
With Sheets("CLUTCH BUILD")
.Rows("11:20").Hidden = False
For xRg = 11 To 20
.Rows(xRg).Hidden = .Cells(xRg, 2) = "" Or .Cells(xRg, 2) = "-"
Next xRg
End With
Dim c As Range
For Each c In Range("A24:N24").Cells
If c.Value = "HIDE" Then
c.EntireColumn.Hidden = True
End If
Next c
Application.ScreenUpdating = True
End Sub
following group code
Sub ALL_HIDE()
MAST_PROD_FORM_HIDE_ALL
CLUTCH_BUILD_HIDE_ALL
TABLE_PROD_HIDE_ALL
FAS_CASS_ASSEM_HIDE_ALL
PACK_SLIP_HIDE_ALL
TACK_SEAL_HIDE_ALL
CUTTER_PROD_HIDE_ALL
ORDER_PROOF_HIDE_ALL
INVOICE_HIDE_ALL
End Sub
Also, I use this same code in 7 other sheets where I just change the row and columns numbers. I made a macro to run all of them sequentially (see below also) but only the first one runs. Is there something in the code that terminates it? Thanks
Sub CLUTCH_BUILD_HIDE_ALL()
Dim xRg As Long
Application.ScreenUpdating = False
With Sheets("CLUTCH BUILD")
.Rows("11:20").Hidden = False
For xRg = 11 To 20
.Rows(xRg).Hidden = .Cells(xRg, 2) = "" Or .Cells(xRg, 2) = "-"
Next xRg
End With
Dim c As Range
For Each c In Range("A24:N24").Cells
If c.Value = "HIDE" Then
c.EntireColumn.Hidden = True
End If
Next c
Application.ScreenUpdating = True
End Sub
following group code
Sub ALL_HIDE()
MAST_PROD_FORM_HIDE_ALL
CLUTCH_BUILD_HIDE_ALL
TABLE_PROD_HIDE_ALL
FAS_CASS_ASSEM_HIDE_ALL
PACK_SLIP_HIDE_ALL
TACK_SEAL_HIDE_ALL
CUTTER_PROD_HIDE_ALL
ORDER_PROOF_HIDE_ALL
INVOICE_HIDE_ALL
End Sub