ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macros (https://www.excelbanter.com/excel-programming/425660-macros.html)

Sri Harsha[_2_]

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

Gary''s Student

Macros
 
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

--
Gary''s Student - gsnu200839

Per Jessen

Macros
 
Hi

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

Sheets("Sheet1").Acitvate

Hopes this helps

--
Per

"Sri Harsha" skrev i meddelelsen
...
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.



Mike H

Macros
 
Hi,

Try this

With Sheets("Sheet1")
.Visible = True
.Select
End With

Mike

"Sri Harsha" wrote:

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.



All times are GMT +1. The time now is 01:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com