Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Turning Colored Cell's Off

When I design a speadsheet, I use color to designate cells
that are protected from cells that are not. While I prefer
this method, others in the group would prefer a white
background on all worksheets. Is there a way to write a
macro which can toggle between both formats? In the past I
have written a macro that can accomplish this goal, but
required more lines of code since I did not know of a
simple multiple line code that could accomplish the same.
Any help would be appreciated. Thank You, JAD
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Turning Colored Cell's Off

Dim bTurnOnColor as Boolean
Dim cell as Range
ActiveSheet.Unprotect
bTurnOnColor = True
for each cell in Activesheet.UsedRange
if cell.locked then
if bTurnOnColor then
cell.Interior.ColorIndex = 5
else
cell.Interior.ColorIndex = xlNone
end if
End if
Next
Activesheet.Protect

--
Regards,
Tom Ogilvy


"JAD" wrote in message
...
When I design a speadsheet, I use color to designate cells
that are protected from cells that are not. While I prefer
this method, others in the group would prefer a white
background on all worksheets. Is there a way to write a
macro which can toggle between both formats? In the past I
have written a macro that can accomplish this goal, but
required more lines of code since I did not know of a
simple multiple line code that could accomplish the same.
Any help would be appreciated. Thank You, JAD



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
Turning =E13 to =$E$13 Bishop Excel Worksheet Functions 3 February 4th 10 06:58 PM
keeps turning off rio Excel Worksheet Functions 4 August 31st 07 02:08 AM
Colored Tabs Woody13 Excel Discussion (Misc queries) 2 April 11th 06 09:07 PM
Turning #N/A to a zero...?? bigtim Excel Discussion (Misc queries) 5 July 26th 05 08:48 PM
Cell right next to colored cells is automatically colored on entering a value Johan De Schutter Excel Programming 6 September 12th 03 05:31 PM


All times are GMT +1. The time now is 07:51 AM.

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"