Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
lock cell based on a condition | Excel Worksheet Functions | |||
Fill a cell based on a condition being met | Excel Worksheet Functions | |||
I want to fill the cell color based upon the other cell condition | Excel Discussion (Misc queries) | |||
Lock out a portion of spreadsheet based on a condition | Excel Programming | |||
Fill Color each Row based on a Condition | Excel Programming |