Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Any knows how can lock the format of the cell. I want users can edit the cell but can not change the font, size, color etc... -- bookton ------------------------------------------------------------------------ bookton's Profile: http://www.excelforum.com/member.php...o&userid=35481 View this thread: http://www.excelforum.com/showthread...hreadid=552546 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Hello Bookton, Copy this macro code, insert a VBA Module into your project, and paste the macro. You can run the macro from Excel by pressing ALT+F8 to display the macro dialog. Select "DisableFormatting" and press the Enter key. This will prevent the user from changing the cell's format, and still allow the cell data to be edited. Code: -------------------- Sub DisableFormatting() Dim CmdBar Dim CmdBarCtrl 'Disable the Formatting toolBar Excel.CommandBars("Formatting").Enabled = False Set CmdBar = Excel.CommandBars("Worksheet Menu Bar") 'Disable the controls on the Format Menu Set CmdBarCtrl = CmdBar.Controls("F&ormat") With CmdBarCtrl .Controls("C&ells...").Enabled = False .Controls("&AutoFormat...").Enabled = False .Controls("Con&ditional Formatting...").Enabled = False End With 'Disable the controls on the Edit Menu Set CmdBarCtrl = CmdBar.Controls("&Edit") With CmdBarCtrl .Controls("Cle&ar").Enabled = False .Controls("F&ill").Enabled = False .Controls("&Delete...").Enabled = False End With 'Disable controls on the Right-Click Context Menu With Excel.CommandBars("Cell") .Controls("F&ormat cells...").Enabled = False .Controls("&Insert...").Enabled = False .Controls("&Delete...").Enabled = False End With End Sub -------------------- Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=552546 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
In excel how do I protect the format of a cell but let the user c. | Excel Discussion (Misc queries) | |||
Conditional Format as a MACRO | Excel Worksheet Functions | |||
Format of a cell | Excel Discussion (Misc queries) | |||
Protect Workbook vs Worksheet?? | Excel Worksheet Functions | |||
can't format cell - have tried unlocking and unprotecting | Excel Discussion (Misc queries) |