#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default vba code

hi everybody,

i have sheet1, sheet2 & sheet3 in a workbook. what i want is, if i save the
file i want to hide sheet2 & sheet3, so only sheet1 is visible. after the
saving i want to show again the hide sheets.

pls. help.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default vba code

Hi,

So sheet2 & sheet3 become hidden when you save but as soon as the save is
complete they become visible again. I must have misunderstood, please clarify.

Mike

"EricBB" wrote:

hi everybody,

i have sheet1, sheet2 & sheet3 in a workbook. what i want is, if i save the
file i want to hide sheet2 & sheet3, so only sheet1 is visible. after the
saving i want to show again the hide sheets.

pls. help.

  #3   Report Post  
Posted to microsoft.public.excel.misc
seb seb is offline
external usenet poster
 
Posts: 1
Default vba code

Hi,

Maybe the question was how to hide unhide sheets ?

seb.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default vba code

Hi Mike,

Thanks for the response.

Exactly, as what you have written.

Pls. help me with this.


"Mike H" wrote:

Hi,

So sheet2 & sheet3 become hidden when you save but as soon as the save is
complete they become visible again. I must have misunderstood, please clarify.

Mike

"EricBB" wrote:

hi everybody,

i have sheet1, sheet2 & sheet3 in a workbook. what i want is, if i save the
file i want to hide sheet2 & sheet3, so only sheet1 is visible. after the
saving i want to show again the hide sheets.

pls. help.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default vba code

I'm still not sure I understand you, probably because I can't imagine why
you'd want to do it. So, at the risk of being completely off-target, try the
following:

Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Visible = False
ActiveWorkbook.Save
Sheets("Sheet2").Visible = True
Sheets("Sheet3").Visible = True
End Sub


"EricBB" wrote:

Hi Mike,

Thanks for the response.

Exactly, as what you have written.

Pls. help me with this.


"Mike H" wrote:

Hi,

So sheet2 & sheet3 become hidden when you save but as soon as the save is
complete they become visible again. I must have misunderstood, please clarify.

Mike

"EricBB" wrote:

hi everybody,

i have sheet1, sheet2 & sheet3 in a workbook. what i want is, if i save the
file i want to hide sheet2 & sheet3, so only sheet1 is visible. after the
saving i want to show again the hide sheets.

pls. help.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default vba code

You don't need to Select each sheet before making it invisible...

Sheets("Sheet2").Visible = False
Sheets("Sheet3").Visible = False
ActiveWorkbook.Save
Sheets("Sheet2").Visible = True
Sheets("Sheet3").Visible = True

Rick


"Daryl Fagala" wrote in message
...
I'm still not sure I understand you, probably because I can't imagine why
you'd want to do it. So, at the risk of being completely off-target, try
the
following:

Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Visible = False
ActiveWorkbook.Save
Sheets("Sheet2").Visible = True
Sheets("Sheet3").Visible = True
End Sub


"EricBB" wrote:

Hi Mike,

Thanks for the response.

Exactly, as what you have written.

Pls. help me with this.


"Mike H" wrote:

Hi,

So sheet2 & sheet3 become hidden when you save but as soon as the save
is
complete they become visible again. I must have misunderstood, please
clarify.

Mike

"EricBB" wrote:

hi everybody,

i have sheet1, sheet2 & sheet3 in a workbook. what i want is, if i
save the
file i want to hide sheet2 & sheet3, so only sheet1 is visible. after
the
saving i want to show again the hide sheets.

pls. help.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
Code to find code D. Excel Discussion (Misc queries) 2 August 12th 07 06:16 PM
Convert a Number Code to a Text Code Traye Excel Discussion (Misc queries) 3 April 6th 07 09:54 PM
Unprotect Code Module in Code Damien Excel Discussion (Misc queries) 2 April 18th 06 03:10 PM
copying vba code to a standard code module 1vagrowr Excel Discussion (Misc queries) 2 November 23rd 05 04:00 PM


All times are GMT +1. The time now is 03:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"