[RESOLVED] Hide Rows on non-active worksheet without activation
Hi Guys - some help please.
I am trying to hide rows in another worksheet without selecting it. My current code is as follows:
---------------------------------------------------------------------
Sub modRowHide(SheetName As String, RowName As String, QtyCell As String)
Sheets(SheetName).Select
Range(RowName).Select
Selection.EntireRow.Hidden = True
Sheets("Menu").Select
Range(QtyCell).Select
Selection.Font.ColorIndex = 2
ActiveCell.FormulaR1C1 = "0"
End Sub
----------------------------------------------------------------------
Problem is that the constant jumping between sheets every time it makes it an active sheet is irretating to the eye as the module is run several times in repeat.
Any suggestions?
Re: Hide Rows on non-active worksheet without activation
You don't need to select sheet and/or cell.
Code:
Sheets(SheetName).Range(RowName).EntireRow.Hidden = True
With Sheets("Menu").Range(QtyCell)
.Font.ColorIndex = 2
.FormulaR1C1 = "0"
End With
Re: Hide Rows on non-active worksheet without activation
Thanks anhn - it does the trick. So simple!