Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Lock condition based on a background fill


Obviously an IF condition, but my knowledge ends here...

All I need is a condition that lock all cells in a worksheet, that ha
a background fill. That condition should be activate when openin
workbook

Seems easy, no?

Thanks, ppl! :

--
jobee
-----------------------------------------------------------------------
jobeer's Profile: http://www.excelforum.com/member.php...fo&userid=3244
View this thread: http://www.excelforum.com/showthread.php?threadid=52314

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Lock condition based on a background fill

in the Thisworkbook module, use the workbook_open event
http://www.cpearson.com/excel/events.htm

Private Sub Workbook_Open
with worksheets("sheet1")
set rng = .UsedRange
.Unprotect Password:="ABCD"
for each cell in rng
if cell.Interior.ColorIndex < xlNone then
cell.locked = True
end if
Next
.Protect Password:="ABCD"
End with
End Sub

--
Regards,
Tom Ogilvy


"jobeer" wrote:


Obviously an IF condition, but my knowledge ends here...

All I need is a condition that lock all cells in a worksheet, that has
a background fill. That condition should be activate when opening
workbook

Seems easy, no?

Thanks, ppl! :)


--
jobeer
------------------------------------------------------------------------
jobeer's Profile: http://www.excelforum.com/member.php...o&userid=32447
View this thread: http://www.excelforum.com/showthread...hreadid=523145


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Lock condition based on a background fill


These cell have values... is there a way to protect them too? :confused


ok, lets say: I have a table with the days of a month (obtained b
formula).
Some days are weekend or hollidays. These particular cells have
background fill.
This worksheet is to set holliday periods for employees. So I don'
want to select Christmas or other hollidays, got it?

So these cells with numbers should be protected, but not for edition
because of the background fill change!

Is this possible

--
jobee
-----------------------------------------------------------------------
jobeer's Profile: http://www.excelforum.com/member.php...fo&userid=3244
View this thread: http://www.excelforum.com/showthread.php?threadid=52314

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Lock condition based on a background fill

No I don't got it. I gave you what you asked for. It is unclear how your
additional information has changed that. The only addendum I would add, is
if the sheet is static, you certainly don't need a macro to do this. Set it
up manually and be done with it.

--
Regards,
Tom Ogilvy

"jobeer" wrote:


These cell have values... is there a way to protect them too?


ok, lets say: I have a table with the days of a month (obtained by
formula).
Some days are weekend or hollidays. These particular cells have a
background fill.
This worksheet is to set holliday periods for employees. So I don't
want to select Christmas or other hollidays, got it?

So these cells with numbers should be protected, but not for edition,
because of the background fill change!

Is this possible?


--
jobeer
------------------------------------------------------------------------
jobeer's Profile: http://www.excelforum.com/member.php...o&userid=32447
View this thread: http://www.excelforum.com/showthread...hreadid=523145


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
lock cell based on a condition Amanda Excel Worksheet Functions 22 June 25th 07 07:53 PM
Fill a cell based on a condition being met confused teacher Excel Worksheet Functions 3 July 5th 06 08:29 AM
I want to fill the cell color based upon the other cell condition sri Excel Discussion (Misc queries) 4 January 12th 06 01:47 PM
Lock out a portion of spreadsheet based on a condition Ryan Excel Programming 11 April 16th 04 09:21 PM
Fill Color each Row based on a Condition Donnie Stone Excel Programming 2 November 2nd 03 01:32 PM


All times are GMT +1. The time now is 12:09 PM.

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"