Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sheet Information - Is sheet protected? | Excel Discussion (Misc queries) | |||
Protected sheet to unprotected sheet | Excel Worksheet Functions | |||
protected sheet | Excel Discussion (Misc queries) | |||
Protected sheet | Excel Programming | |||
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet | Excel Programming |