Making macro

  • Thread starter Thread starter Guest
  • Start date Start date
Private Sub Worksheet_Activate()
Worksheets("Sheet1").Visible = xlSheetHidden
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the Sheet2 worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Right click on the tabl for sheet 2 and select View Code. Paste the following
code...

Private Sub Worksheet_Activate()
Sheets("Sheet1").Visible = xlSheetHidden
End Sub
 
Thank you very much for your help

I want the macro run as soon as I select sheet2 sheet1 to be hide

regards
 
Thank you very much for your help

I want the macro run as soon as I select sheet2 sheet1 to be hide

regards
 
please ignore my previous massage your massage was very clear and very
helpful thanks again
 
please ignore my previous massage your massage was very clear and very
helpful thanks again
 
That is what Bob's event code does.

When sheet2 is activated, sheet1 hides.

Did you paste the code into the sheet2 module as Bob instructed?


Gord Dibben MS Excel MVP
 
Back
Top