Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default is sheet protected?

i want to paint some cells in red if the activesheet is not protected
(conditional formatting)

ather question:
a vba code "if the activesheet is unprotected then...."

thank you
rozent
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default is sheet protected?


Hello ×¨×•×–× ×˜,

In VBA...
If ActiveSheet.ProtectionMode = True Then
ActiveSheet.Range(MyRange).Interior.ColorIndex = 3
End If

MyRange is the range you want to color red.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=557637

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default is sheet protected?

thank you
what about the first part of my question:
" i want to paint some cells in red if the activesheet is not protected
(by conditional formatting)" not vba

rozent

"Leith Ross" wrote:


Hello ר×€¢Ã—€“× ט,

In VBA...
If ActiveSheet.ProtectionMode = True Then
ActiveSheet.Range(MyRange).Interior.ColorIndex = 3
End If

MyRange is the range you want to color red.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=557637


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default is sheet protected?

sory but it dosnt work
i tried this:

Sub if_protected()
On Error Resume Next
If ActiveSheet.ProtectionMode = True Then
'ActiveSheet.Range(MyRange).Interior.ColorIndex = 3
MsgBox "protected"
Exit Sub
Else
MsgBox "not protected"
End If
End Sub

i get all ways "not protected"

rozent

"Leith Ross" wrote:


Hello ר×€¢Ã—€“× ט,

In VBA...
If ActiveSheet.ProtectionMode = True Then
ActiveSheet.Range(MyRange).Interior.ColorIndex = 3
End If

MyRange is the range you want to color red.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=557637


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default is sheet protected?

You can protect a few different things on a worksheet.

Dim wks as worksheet
set wks = activesheet

If wks.ProtectContents _
Or wks.ProtectDrawingObjects _
Or wks.ProtectScenarios Then
msgbox "It's protected"
Else
'do the work to add the conditional formatting
end if



????? wrote:

i want to paint some cells in red if the activesheet is not protected
(conditional formatting)

ather question:
a vba code "if the activesheet is unprotected then...."

thank you
rozent


--

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
Sheet Information - Is sheet protected? lbit Excel Discussion (Misc queries) 1 November 15th 07 08:06 PM
Protected sheet to unprotected sheet [email protected] Excel Worksheet Functions 2 October 26th 05 05:30 PM
protected sheet 91syncro Excel Discussion (Misc queries) 1 February 9th 05 06:16 PM
Protected sheet Tom Ogilvy Excel Programming 3 August 31st 04 03:28 PM
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet arunjoshi[_5_] Excel Programming 1 May 2nd 04 03:50 PM


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