Microsoft Office Forums


Reply
Thread Tools Display Modes

Prevent formula entry

 
 
news.freedom2surf.net
Guest
Posts: n/a

 
      05-15-2007, 08:56 AM
Hi,

I have a workbook which I want to prevent users from entering formulae
globally across the entire workbook.

There are however formuale already entered into the workbook but want to
prevent any new formulae being entered.

Can this be accomplished? How would I do this?

Many thanks.

Ian E.


 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a

 
      05-15-2007, 09:34 AM
Nothing built-in, but you can check either at the WS or WB level:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range

Application.EnableEvents = False
For Each Cell In Target.Cells
If Cell.HasFormula = True Then
Cell.Value = ""
MsgBox "No formulae allowed"
End If
Next
Application.EnableEvents = True

End Sub

NickHK

"news.freedom2surf.net" <(E-Mail Removed)> wrote in message
news:f2bsjf$mb$(E-Mail Removed)...
> Hi,
>
> I have a workbook which I want to prevent users from entering formulae
> globally across the entire workbook.
>
> There are however formuale already entered into the workbook but want to
> prevent any new formulae being entered.
>
> Can this be accomplished? How would I do this?
>
> Many thanks.
>
> Ian E.
>
>



 
Reply With Quote
 
JLatham
Guest
Posts: n/a

 
      05-15-2007, 09:35 AM
You need to use worksheet protection to keep cells you don't want to be
altered from being altered. Cells that are Locked cannot be altered once
worksheet protection is enabled. All cells are locked by default in a new
workbook, so your first task is to identify all cells that you DO want your
users to be able to use and unlock them. This is done via Format | Cells
and clearing the Locked option on the [Protection] tab in that dialog. Any
cells that are associated with controls and any that are altered via VBA
coding will also need to be unlocked.

Workbook/worksheet protection is accessed through Tools | Protection.

Keep in mind that even using a password for protection is not 100% in Excel.
There are lots of workbook/worksheet password cracking programs available
that are effective and fast! But for the typical use, they suffice.

"news.freedom2surf.net" wrote:

> Hi,
>
> I have a workbook which I want to prevent users from entering formulae
> globally across the entire workbook.
>
> There are however formuale already entered into the workbook but want to
> prevent any new formulae being entered.
>
> Can this be accomplished? How would I do this?
>
> Many thanks.
>
> Ian E.
>
>
>

 
Reply With Quote
 
JLatham
Guest
Posts: n/a

 
      05-15-2007, 09:41 AM
I guess while I was typing, so was NickHK - and it causes me to add this:
he's right in that people would be able to enter formulas into unlocked
cells. If your intent is to prevent adding formulas anywhere, then perhaps a
combination of my recommendation and a modification of his to examine the
cells you know to be unlocked would work for you.

"JLatham" wrote:

> You need to use worksheet protection to keep cells you don't want to be
> altered from being altered. Cells that are Locked cannot be altered once
> worksheet protection is enabled. All cells are locked by default in a new
> workbook, so your first task is to identify all cells that you DO want your
> users to be able to use and unlock them. This is done via Format | Cells
> and clearing the Locked option on the [Protection] tab in that dialog. Any
> cells that are associated with controls and any that are altered via VBA
> coding will also need to be unlocked.
>
> Workbook/worksheet protection is accessed through Tools | Protection.
>
> Keep in mind that even using a password for protection is not 100% in Excel.
> There are lots of workbook/worksheet password cracking programs available
> that are effective and fast! But for the typical use, they suffice.
>
> "news.freedom2surf.net" wrote:
>
> > Hi,
> >
> > I have a workbook which I want to prevent users from entering formulae
> > globally across the entire workbook.
> >
> > There are however formuale already entered into the workbook but want to
> > prevent any new formulae being entered.
> >
> > Can this be accomplished? How would I do this?
> >
> > Many thanks.
> >
> > Ian E.
> >
> >
> >

 
Reply With Quote
 
Harlan Grove
Guest
Posts: n/a

 
      06-22-2007, 03:42 AM
"NickHK" <(E-Mail Removed)> wrote...
>Nothing built-in, but you can check either at the WS or WB level:
>
>Private Sub Worksheet_Change(ByVal Target As Range)
> Dim Cell As Range
>
> Application.EnableEvents = False
> For Each Cell In Target.Cells
> If Cell.HasFormula = True Then
> Cell.Value = ""
> MsgBox "No formulae allowed"
> End If
> Next
> Application.EnableEvents = True
>
>End Sub


Note that this can be defeated easily by disabling macros.

Personally, I can't think of any good reason to prevent users from making
any valid entries, constants or formulas. It won't prevent users from trying
to find values in hidden worksheets/rows/columns. All they'd need to do is
open a new workbook and enter formulas with external references into the
'protected' workbook.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent entry of duplicates RobertG Access Newsgroup 4 03-03-2008 05:16 PM
Validation rule to prevent entry simonc Access Newsgroup 2 05-23-2006 06:56 PM
Is there a way to prevent data entry into table-only design? Pat Dools Access Newsgroup 2 07-10-2005 02:57 PM
Prevent duplication at time of entry Bruce Access Newsgroup 3 12-03-2004 05:31 PM
Hot do I prevent display of an entry e.g. a password? Larry Grein Access Newsgroup 3 10-08-2004 07:07 PM



All times are GMT. The time now is 02:03 PM.