Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi,
Is it possible within an excel sheet, to use an 'if' statement to protect a cell?? ie if B91, "inc"....but i dont want the user to be able to alter that cell because if they delete it, they will delete the formula. Any suggestions are appreciated.Thanks!!!!! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can prevent the user from selecting the cell in the first place.
Right-click the sheet tab, select View Code, enter this: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$B$9" Then '<===change this if you wish Range("A1").Select End If End Sub Bob Umlas Excel MVP "gav meredith" wrote in message ... hi, Is it possible within an excel sheet, to use an 'if' statement to protect a cell?? ie if B91, "inc"....but i dont want the user to be able to alter that cell because if they delete it, they will delete the formula. Any suggestions are appreciated.Thanks!!!!! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Bob. That is not quite what im after but very handy to know and i
will use it actually. To clarify, the user has 2 options......1 is to select an item as an inclusion and if they do so, the price is shown (in lets say d9) and the corresponding cell (e9) should show this by stating "inc" If it is not an inclusion they should be able to select (e9) and insert a 1 to show it as an option. Summarised, if d91, then d10 should show "inc". Cant use an if statement though because they might delete the formula.......any other codes??? cheers!!! "Bob Umlas" wrote in message ... You can prevent the user from selecting the cell in the first place. Right-click the sheet tab, select View Code, enter this: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$B$9" Then '<===change this if you wish Range("A1").Select End If End Sub Bob Umlas Excel MVP "gav meredith" wrote in message ... hi, Is it possible within an excel sheet, to use an 'if' statement to protect a cell?? ie if B91, "inc"....but i dont want the user to be able to alter that cell because if they delete it, they will delete the formula. Any suggestions are appreciated.Thanks!!!!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Data Protection Best Practice: AKA: Real Sheet Protection | Excel Discussion (Misc queries) | |||
Excel Data Protection- AKA: Sheet/Macro Password Protection | Setting up and Configuration of Excel | |||
cell protection | Excel Discussion (Misc queries) | |||
Password Protection - paste to unprotected cell locks the cell | Excel Discussion (Misc queries) | |||
Cell Protection vs. Worksheet Protection | Excel Discussion (Misc queries) |