Control a worksheet w/o activating


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.
 
Ad

Advertisements

J

Jayson

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
 
J

Jayson

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
 
Ad

Advertisements

J

JLGWhiz

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
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top