ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro for sheet hide (https://www.excelbanter.com/excel-programming/445401-macro-sheet-hide.html)

kalpesh

macro for sheet hide
 
Hello,

a workbook contain 5 worksheet

i work in sheet1
i would like hide other sheets by macro

any help?

isabelle

macro for sheet hide
 
hi,

in ThisworkBook


Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.EnableEvents = False
For i = 1 To Sheets.Count
If Sheets(i).Name < Sh.Name Then Sheets(i).Visible = False
Next
Application.EnableEvents = True
End Sub



--
isabelle




Le 2012-02-18 12:23, kalpesh a écrit :
Hello,

a workbook contain 5 worksheet

i work in sheet1
i would like hide other sheets by macro

any help?


Gord Dibben[_2_]

macro for sheet hide
 
Do you mean working in Sheet1 specifically or any sheet you are
working on?

If you do hide them will you want some method of uh-hiding later?

Isabelle's code works on whichever worksheet is currently in use.

If you un-hide a sheet through FormatSheetUnhide then it swaps with
the sheet that was visible.

Is that what you want?


Gord



On Sat, 18 Feb 2012 11:23:30 -0600, kalpesh
wrote:

Hello,

a workbook contain 5 worksheet

i work in sheet1
i would like hide other sheets by macro

any help?



All times are GMT +1. The time now is 10:00 AM.

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