Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
how do I lock the fill color in a cell
Can i lock the fill color in a cell so when something is copied to that cell
it stays the locked color. Thank You |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
how do I lock the fill color in a cell
This is an example using cell A1:
1. set the background color of cell A1 2. enter the following macro in a standard module: Public oldcolor As Integer Public lockcell As Range Sub remember() If lockcell Is Nothing Then Set lockcell = Range("A1") oldcolor = lockcell.Interior.ColorIndex End If End Sub 3. Enter this event macro in the worksheet code area: Private Sub Worksheet_Change(ByVal Target As Range) If lockcell Is Nothing Then Exit Sub If Intersect(lockcell, Target) Is Nothing Then Exit Sub lockcell.Interior.ColorIndex = oldcolor End Sub 4. run the remember macro -- Gary''s Student - gsnu200832 "Graham" wrote: Can i lock the fill color in a cell so when something is copied to that cell it stays the locked color. Thank You |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I fill one cell color with text html/rgb color from another | Excel Discussion (Misc queries) | |||
color of cell fill | Excel Worksheet Functions | |||
I need to lock cell color, but allow text - how do I do this? | Excel Discussion (Misc queries) | |||
Cell Fill Color and text color - changes for recipient | Excel Discussion (Misc queries) | |||
Lock or Unlock cell references in a formula for auto fill purposes | Excel Discussion (Misc queries) |