Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default hide columns/rows/cells on open

I want to automatically hide columns when the user opens a password protected
sheet or workbook. The users with the passwords sometimes leave the hidden
columns in unhidden when they save and close. How do I make sure that hidden
columns etc. are automatically hidden on all sheets when the workbook is
opened.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default hide columns/rows/cells on open

hi
you did say how many sheets or what columns to hide but here is the syntax...

Private Sub Workbook_Open()
Sheets("sheet1").Columns("C:C").EntireColumn.Hidde n = True
Sheets("sheet2").Columns("C:C").EntireColumn.Hidde n = True
End Sub

adjust to suit your data.
personally i would use the before save event and hidde on close instead of
open
might be just me.

Regards
FSt1
"notso" wrote:

I want to automatically hide columns when the user opens a password protected
sheet or workbook. The users with the passwords sometimes leave the hidden
columns in unhidden when they save and close. How do I make sure that hidden
columns etc. are automatically hidden on all sheets when the workbook is
opened.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default hide columns/rows/cells on open

remembering that if it's protected you would need to unprotect to do this

Sheets("Sheet3").Unprotect Password:="MyPass"
Sheets("sheet3").Columns("C:C").EntireColumn.Hidde n = True
Sheets("Sheet3").Protect Password:="MyPass"

Mike

"FSt1" wrote:

hi
you did say how many sheets or what columns to hide but here is the syntax...

Private Sub Workbook_Open()
Sheets("sheet1").Columns("C:C").EntireColumn.Hidde n = True
Sheets("sheet2").Columns("C:C").EntireColumn.Hidde n = True
End Sub

adjust to suit your data.
personally i would use the before save event and hidde on close instead of
open
might be just me.

Regards
FSt1
"notso" wrote:

I want to automatically hide columns when the user opens a password protected
sheet or workbook. The users with the passwords sometimes leave the hidden
columns in unhidden when they save and close. How do I make sure that hidden
columns etc. are automatically hidden on all sheets when the workbook is
opened.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default hide columns/rows/cells on open

opps.
forgot about that part.
thanks mike

regards
FSt1

"Mike H" wrote:

remembering that if it's protected you would need to unprotect to do this

Sheets("Sheet3").Unprotect Password:="MyPass"
Sheets("sheet3").Columns("C:C").EntireColumn.Hidde n = True
Sheets("Sheet3").Protect Password:="MyPass"

Mike

"FSt1" wrote:

hi
you did say how many sheets or what columns to hide but here is the syntax...

Private Sub Workbook_Open()
Sheets("sheet1").Columns("C:C").EntireColumn.Hidde n = True
Sheets("sheet2").Columns("C:C").EntireColumn.Hidde n = True
End Sub

adjust to suit your data.
personally i would use the before save event and hidde on close instead of
open
might be just me.

Regards
FSt1
"notso" wrote:

I want to automatically hide columns when the user opens a password protected
sheet or workbook. The users with the passwords sometimes leave the hidden
columns in unhidden when they save and close. How do I make sure that hidden
columns etc. are automatically hidden on all sheets when the workbook is
opened.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default hide columns/rows/cells on open

Thank you. Is the same true if I hade on close? I tried this and decided not
to because the user is prompted to save the document and if they don't save
it, then the columns are not hidden when they re-open. Plus if the user does
not change anything I don't want them to get confused when the work book asks
them whether or not they want to save. If you can send me the code to hide
on close with the characteristics outlined above, that would be great!
Thanks!

"Mike H" wrote:

remembering that if it's protected you would need to unprotect to do this

Sheets("Sheet3").Unprotect Password:="MyPass"
Sheets("sheet3").Columns("C:C").EntireColumn.Hidde n = True
Sheets("Sheet3").Protect Password:="MyPass"

Mike

"FSt1" wrote:

hi
you did say how many sheets or what columns to hide but here is the syntax...

Private Sub Workbook_Open()
Sheets("sheet1").Columns("C:C").EntireColumn.Hidde n = True
Sheets("sheet2").Columns("C:C").EntireColumn.Hidde n = True
End Sub

adjust to suit your data.
personally i would use the before save event and hidde on close instead of
open
might be just me.

Regards
FSt1
"notso" wrote:

I want to automatically hide columns when the user opens a password protected
sheet or workbook. The users with the passwords sometimes leave the hidden
columns in unhidden when they save and close. How do I make sure that hidden
columns etc. are automatically hidden on all sheets when the workbook is
opened.

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
Hide columns and rows delete automatically Excel Worksheet Functions 2 September 25th 07 12:49 AM
Is there a way to hide worksheets and/or rows/columns based on information enter into a particular cell of range of cells? Marc New Users to Excel 1 March 10th 06 05:10 PM
how do i hide columns in excel so no one can open them. brianb Excel Discussion (Misc queries) 2 February 5th 06 10:09 PM
Hide columns & rows that contain "0" or blank in a range of cells lw new guest Excel Worksheet Functions 0 August 18th 05 04:27 PM
How do I hide rows in excell 2003, and see the + sign to open? S.L.Johnson Excel Worksheet Functions 2 June 21st 05 08:30 PM


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

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

About Us

"It's about Microsoft Excel"