Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Selection.Interior.ColorIndex = 0 Error

I have a combo box and based on the answer in the combo box, I need the
cell color to change to 'gray out' when then answer is no. It works
great without protection turned on, but once I turn on sheet
protection, it doesn't work anymore. I need the rest of the sheet
protected. I unchecked the 'locked' and 'hidden' boxes on the cell I
need to turn gray. I also have the value of the cell changing from 65
to N/A and that part works great.

I'm stumped. What do I do?

Thanks in advance,
Laura

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Selection.Interior.ColorIndex = 0 Error

Unprotect the sheet while the macro is running and re-protect it at the end

Sub DoWhatever()
activesheet.unprotect "MyPassword"
'Do your Stuff
activesheet.protect "MyPassword"
end sub

--
HTH...

Jim Thomlinson


" wrote:

I have a combo box and based on the answer in the combo box, I need the
cell color to change to 'gray out' when then answer is no. It works
great without protection turned on, but once I turn on sheet
protection, it doesn't work anymore. I need the rest of the sheet
protected. I unchecked the 'locked' and 'hidden' boxes on the cell I
need to turn gray. I also have the value of the cell changing from 65
to N/A and that part works great.

I'm stumped. What do I do?

Thanks in advance,
Laura


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Selection.Interior.ColorIndex = 0 Error

Hi Laura,

Alternatively, try setting the Protect method's UserInterfaceOnly parameter
to True which enables vba manipulation of the protected sheet.

However, this setting is not persistent and needs to be reset each time the
workbook is opened.

Perhaps, therefore, you could set protection in the Workbook_Open or
Auto_Open procedures, e.g.:

Sub Auto_Open()
With Worksheets("Your Sheet Name")
.Protect Password:="Your Password", UserInterfaceOnly:=True
End With
End Sub


---
Regards,
Norman



wrote in message
oups.com...
I have a combo box and based on the answer in the combo box, I need the
cell color to change to 'gray out' when then answer is no. It works
great without protection turned on, but once I turn on sheet
protection, it doesn't work anymore. I need the rest of the sheet
protected. I unchecked the 'locked' and 'hidden' boxes on the cell I
need to turn gray. I also have the value of the cell changing from 65
to N/A and that part works great.

I'm stumped. What do I do?

Thanks in advance,
Laura



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Selection.Interior.ColorIndex = 0 Error

Sorry I should also have mentioned taht depending what version of Excel you
are running you cna check the User Interface Only option. With this checked
VBA has free reign to do what it wants but the user is restricted...
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Unprotect the sheet while the macro is running and re-protect it at the end

Sub DoWhatever()
activesheet.unprotect "MyPassword"
'Do your Stuff
activesheet.protect "MyPassword"
end sub

--
HTH...

Jim Thomlinson


" wrote:

I have a combo box and based on the answer in the combo box, I need the
cell color to change to 'gray out' when then answer is no. It works
great without protection turned on, but once I turn on sheet
protection, it doesn't work anymore. I need the rest of the sheet
protected. I unchecked the 'locked' and 'hidden' boxes on the cell I
need to turn gray. I also have the value of the cell changing from 65
to N/A and that part works great.

I'm stumped. What do I do?

Thanks in advance,
Laura


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
Sumif interior.colorindex condition John Excel Worksheet Functions 7 June 1st 06 01:17 AM
Use of Interior.ColorIndex liquidhot Excel Programming 4 June 27th 05 07:22 PM
interior.colorindex used with conditional formatting Wazooli Excel Worksheet Functions 7 February 25th 05 01:01 AM
Testing for Interior.ColorIndex JeffBo Excel Programming 7 May 17th 04 09:41 PM
Unable to set the colorIndex Property of the Interior Class Error GriffyGriff Excel Programming 3 October 3rd 03 04:37 PM


All times are GMT +1. The time now is 09:56 AM.

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

About Us

"It's about Microsoft Excel"