Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 51
Default How to Check if Worksheet TAB is protected or Not

Want to Check if Worksheet is protected or not. If not protected want to
protect with a password Something If it is protected ignore action.

How to do this programatically

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default How to Check if Worksheet TAB is protected or Not

If ActiveWorkbook.Sheets("Sheet2").Visible = -1 Then
ActiveWorkbook.Sheets("sheet2").Protect Password:="password"
ActiveWorkbook.Sheets("Sheet2").Visible = False
End If

--
If this post helps click Yes
---------------
Jacob Skaria


"Ananth" wrote:

Want to Check if Worksheet is protected or not. If not protected want to
protect with a password Something If it is protected ignore action.

How to do this programatically

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default How to Check if Worksheet TAB is protected or Not

If Not ActiveSheet.ProtectContents Then _
ActiveSheet.Protect Password:="Something", DrawingObjects:=True,
Contents:=True, Scenarios:=True

Regards,
Stefi

Ananth ezt *rta:

Want to Check if Worksheet is protected or not. If not protected want to
protect with a password Something If it is protected ignore action.

How to do this programatically

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to Check if Worksheet TAB is protected or Not

With worksheets("SomesheetNameHere")
If .ProtectContents = True _
Or .ProtectDrawingObjects = True _
Or .ProtectScenarios = True Then
'do nothing, it's already protected
Else
.Protect Password:="Something"
End If
End With



Ananth wrote:

Want to Check if Worksheet is protected or not. If not protected want to
protect with a password Something If it is protected ignore action.

How to do this programatically


--

Dave Peterson
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
Spell check when worksheet is protected Brian Excel Discussion (Misc queries) 3 May 9th 08 01:18 AM
unprotect check box in protected worksheet Laura Bennett Excel Discussion (Misc queries) 1 September 12th 06 05:12 PM
Spell Check cells in Protected Worksheet? Jugglertwo Excel Discussion (Misc queries) 1 July 27th 06 08:27 PM
spell check for protected worksheet for Excel 97 Jessica Excel Discussion (Misc queries) 1 March 18th 05 05:48 PM
Why doesn't spell check work on a protected worksheet? Creating Order Forms is Fun Excel Worksheet Functions 6 December 22nd 04 07:34 PM


All times are GMT +1. The time now is 04:10 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"