Control a worksheet w/o activating

  • Thread starter Thread starter Cerberus
  • Start date Start date
C

Cerberus

I have a worksheet ("Cut") that has a hide macro associated with a worksheet
activation. I would like to unhide that page when I activate another
worksheet ("Order").

I have tried:

Private Sub Worksheet_Activate()
Sheets ("Cut")
Cells.Select
Selection.EntireRow.Hidden = False
End Sub

But obviously that is not the answer. Any ideas? Thanks in advance for
your assistance.
 
Do you mean unhide rows on "Cut", or unhide the entire sheet?

Private Sub Worksheet_Activate()
'To unhide the sheet
Sheets("Cut").Visible = xlSheetVisible
'To unhide rows - adjust the range to include the rows you want unhidden
Sheets("Cut").range("A1:A5").entirerow.hidden = false
End Sub
 
This should do it. Place this in the "Order" worksheet code.

Private Sub Worksheet_Activate()
'To unhide rows - adjust the range to include the rows you want unhidden
Sheets("Cut").Range("A1:A5").EntireRow.Hidden = False
End Sub
 
Sheets use the "Visible" property and rows use the "Hidden" property.
Visible can be used two ways with a sheet:

Object.Visible = (xlSheetVisible or xlSheetHidden)
Object.Vixible = (True or False)

More details in the VBA help file under Visible Property
 
Back
Top