Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub TestForProtect()
Dim myrng As Range Dim c As Range Set myrng = Range("A1:B5") For Each c In myrng If c.Locked = False Then c.Interior.ColorIndex = 6 <<< R/T 1004 *** End If Next c End Sub *** Unable to set the Colorindex property of the Iterior Class... ???? How can I fix? TIA, |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One possibility is, that you have your sheet protected.
If so, unprotect it in the beginning and protect it at the end of the macro. Wolf "Jim May" wrote: Sub TestForProtect() Dim myrng As Range Dim c As Range Set myrng = Range("A1:B5") For Each c In myrng If c.Locked = False Then c.Interior.ColorIndex = 6 <<< R/T 1004 *** End If Next c End Sub *** Unable to set the Colorindex property of the Iterior Class... ???? How can I fix? TIA, |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If the sheet is protected, then even an unlocked cell can not normally be
formatted. (in xl2002 and later, there are options for this). In general, things that you can't do manually can not be done in code either. You also might look at the UserInterFaceOnly setting of the protect method for greater flexibility. -- Regards, Tom Ogilvy "Jim May" wrote in message news:pldWe.23744$8q.15872@lakeread01... Sub TestForProtect() Dim myrng As Range Dim c As Range Set myrng = Range("A1:B5") For Each c In myrng If c.Locked = False Then c.Interior.ColorIndex = 6 <<< R/T 1004 *** End If Next c End Sub *** Unable to set the Colorindex property of the Iterior Class... ???? How can I fix? TIA, |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom,
"Tom Ogilvy" wrote in message ... If the sheet is protected, then even an unlocked cell can not normally be formatted. (in xl2002 and later, there are options for this). In general, things that you can't do manually can not be done in code either. You also might look at the UserInterFaceOnly setting of the protect method for greater flexibility. -- Regards, Tom Ogilvy "Jim May" wrote in message news:pldWe.23744$8q.15872@lakeread01... Sub TestForProtect() Dim myrng As Range Dim c As Range Set myrng = Range("A1:B5") For Each c In myrng If c.Locked = False Then c.Interior.ColorIndex = 6 <<< R/T 1004 *** End If Next c End Sub *** Unable to set the Colorindex property of the Iterior Class... ???? How can I fix? TIA, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro code to put series name next to individual line in line grap | Charts and Charting in Excel | |||
Code to delete a Line in a another code | Excel Programming | |||
sumproduct bombs out | Excel Worksheet Functions | |||
Continue line of VBA code on the next line | Excel Programming | |||
Macro runs in Excel 2003, bombs in XP - Compatability question | Excel Programming |