Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Cell protection

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 301
Default Cell protection

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Cell protection

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Data Protection Best Practice: AKA: Real Sheet Protection Mushman(Woof!)[_2_] Excel Discussion (Misc queries) 4 December 30th 09 01:20 AM
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
cell protection Steve Excel Discussion (Misc queries) 1 September 22nd 07 04:24 PM
Password Protection - paste to unprotected cell locks the cell Jimbob Excel Discussion (Misc queries) 7 September 7th 07 06:22 PM
Cell Protection vs. Worksheet Protection kmwhitt Excel Discussion (Misc queries) 4 September 24th 06 02:37 AM


All times are GMT +1. The time now is 08:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"