Cell protection

  • Thread starter Thread starter gav meredith
  • Start date Start date
G

gav meredith

hi,

Is it possible within an excel sheet, to use an 'if' statement to protect a
cell?? ie if B9>1, "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!!!!!
 
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
 
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 d9>1, then d10 should show "inc". Cant
use an if statement though because they might delete the formula.......any
other codes???

cheers!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top