Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
lock cells with values
with below statements
Range("A1:P30").Select Selection.SpecialCells(xlCellTypeFormulas, 23).Select Selection.Locked = True I can select a range and then lock any cell with formulas... How do I do same but want to lock any cell with formulas and/or values? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
lock cells with values
Hi,
Dim MyRange As Range Set MyRange = Range("A1:P30").SpecialCells(xlCellTypeConstants) Range("A1:P30").SpecialCells(xlCellTypeFormulas).S elect Set MyRange = Union(MyRange, Selection) MyRange.Locked = True Locking has no effect until the sheet is protected. Mike "Alberto Ast" wrote: with below statements Range("A1:P30").Select Selection.SpecialCells(xlCellTypeFormulas, 23).Select Selection.Locked = True I can select a range and then lock any cell with formulas... How do I do same but want to lock any cell with formulas and/or values? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
lock cells with values
with below statements
Range("A1:P30").Select Selection.SpecialCells(xlCellTypeFormulas, 23).Select Selection.Locked = True I can select a range and then lock any cell with formulas... On Error Resume Next Range("A1:P30").SpecialCells(xlCellTypeFormulas).L ocked = True How do I do same but want to lock any cell with formulas and/or values? On Error Resume Next Union(Range("A1:P30").SpecialCells(xlCellTypeConst ants), _ Range("A1:P30").SpecialCells(xlCellTypeFormulas)). Locked = True -- Rick (MVP - Excel) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Lock Axis Values? | Charts and Charting in Excel | |||
Any way to Lock format but not the values? | Excel Discussion (Misc queries) | |||
how do I lock values in excel | Excel Worksheet Functions | |||
How do I lock cells so their values don't get updated | Excel Programming | |||
Lock cells for combo box values only | Excel Programming |