Macros

S

Sri Harsha

I have recorded a macro that unhides a sheet from the existing workbook. But
when i run it now, it unhides but remains in the existing sheet. I want it to
take me to the sheet that has been unhidden.

Pls help.
 
G

Gary''s Student

Sub qwerty()
Dim s As Worksheet
For Each s In Worksheets
If s.Visible = False Then
s.Visible = True
s.Activate
Else
End If
Next
End Sub
 
P

Per Jessen

Hi

You need to activate the sheet like this once it's unhidden:

Sheets("Sheet1").Acitvate

Hopes this helps
 

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