ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I unhide all sheets on the left of Excel (https://www.excelbanter.com/excel-programming/425278-how-do-i-unhide-all-sheets-left-excel.html)

Saucer Man

How do I unhide all sheets on the left of Excel
 
I have a macro that creates many temporary sheets and then deletes them. It
creates so many that my original sheets get hidden on the left of excel.
After the deletes, it doesn't move the sheets that are hidden on the left
back into view. Is there a VBA statement that will accomplish this?

--
Thanks!



Rick Rothstein

How do I unhide all sheets on the left of Excel
 
Give this statement a try...

Worksheets(1).Select

--
Rick (MVP - Excel)


"Saucer Man" wrote in message
...
I have a macro that creates many temporary sheets and then deletes them.
It creates so many that my original sheets get hidden on the left of excel.
After the deletes, it doesn't move the sheets that are hidden on the left
back into view. Is there a VBA statement that will accomplish this?

--
Thanks!



JLGWhiz

How do I unhide all sheets on the left of Excel
 
You can run this macro.


Sub due()
For i = 2 To ThisWorkbook.Sheets.Count
If Sheets(i).Visible = False Then
Sheets(i).Visible = True
Next
End Sub


"Saucer Man" wrote:

I have a macro that creates many temporary sheets and then deletes them. It
creates so many that my original sheets get hidden on the left of excel.
After the deletes, it doesn't move the sheets that are hidden on the left
back into view. Is there a VBA statement that will accomplish this?

--
Thanks!




JLGWhiz[_2_]

How do I unhide all sheets on the left of Excel
 
I read that post wrong. Disregard my previous suggestion.


"JLGWhiz" wrote in message
...
You can run this macro.


Sub due()
For i = 2 To ThisWorkbook.Sheets.Count
If Sheets(i).Visible = False Then
Sheets(i).Visible = True
Next
End Sub


"Saucer Man" wrote:

I have a macro that creates many temporary sheets and then deletes them.
It
creates so many that my original sheets get hidden on the left of excel.
After the deletes, it doesn't move the sheets that are hidden on the left
back into view. Is there a VBA statement that will accomplish this?

--
Thanks!






Saucer Man

How do I unhide all sheets on the left of Excel
 
That does bring the sheets out but I want the latest sheet to be the one
that is selected. Since the sheets are named Jan, Feb, Mar, etc., would the
best way to do this be ...

Sheets("Jan").Select
Sheets(Month(Now)).Select



"Rick Rothstein" wrote in message
...
Give this statement a try...

Worksheets(1).Select

--
Rick (MVP - Excel)


"Saucer Man" wrote in message
...
I have a macro that creates many temporary sheets and then deletes them.
It creates so many that my original sheets get hidden on the left of
excel. After the deletes, it doesn't move the sheets that are hidden on
the left back into view. Is there a VBA statement that will accomplish
this?

--
Thanks!






Rick Rothstein

How do I unhide all sheets on the left of Excel
 
That is almost right; however, the Month function returns a number, not
text. You should use this for your last statement...

Sheets(MonthName(Month(Now), True)).Select

as that will return the current month's abbreviated name (change True to
False, or leave that argument out completely, and the MonthName function
returns the fully spelled out month name). By the way, you might try just
using this last statement by itself, without the Sheets("Jan") statement,
and see if it brings out all the sheets directly.

--
Rick (MVP - Excel)


"Saucer Man" wrote in message
...
That does bring the sheets out but I want the latest sheet to be the one
that is selected. Since the sheets are named Jan, Feb, Mar, etc., would
the best way to do this be ...

Sheets("Jan").Select
Sheets(Month(Now)).Select



"Rick Rothstein" wrote in message
...
Give this statement a try...

Worksheets(1).Select

--
Rick (MVP - Excel)


"Saucer Man" wrote in message
...
I have a macro that creates many temporary sheets and then deletes them.
It creates so many that my original sheets get hidden on the left of
excel. After the deletes, it doesn't move the sheets that are hidden on
the left back into view. Is there a VBA statement that will accomplish
this?

--
Thanks!







Saucer Man

How do I unhide all sheets on the left of Excel
 
Thanks a lot. Leaving out the first statement did not bring out the rest of
the sheets. Thanks for the help everyone.

"Rick Rothstein" wrote in message
...
That is almost right; however, the Month function returns a number, not
text. You should use this for your last statement...

Sheets(MonthName(Month(Now), True)).Select

as that will return the current month's abbreviated name (change True to
False, or leave that argument out completely, and the MonthName function
returns the fully spelled out month name). By the way, you might try just
using this last statement by itself, without the Sheets("Jan") statement,
and see if it brings out all the sheets directly.

--
Rick (MVP - Excel)


"Saucer Man" wrote in message
...
That does bring the sheets out but I want the latest sheet to be the one
that is selected. Since the sheets are named Jan, Feb, Mar, etc., would
the best way to do this be ...

Sheets("Jan").Select
Sheets(Month(Now)).Select



"Rick Rothstein" wrote in message
...
Give this statement a try...

Worksheets(1).Select

--
Rick (MVP - Excel)


"Saucer Man" wrote in message
...
I have a macro that creates many temporary sheets and then deletes them.
It creates so many that my original sheets get hidden on the left of
excel. After the deletes, it doesn't move the sheets that are hidden on
the left back into view. Is there a VBA statement that will accomplish
this?

--
Thanks!











All times are GMT +1. The time now is 12:30 AM.

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