PDA

View Full Version : Solved: limit users not to add/enter farmula



skaswani
11-08-2007, 01:55 PM
HEllo

i have to make a Excel file, what i want that whom ever i give that file will not be able to ADD any SUM() or any Function/Farmula


thanks.

unmarkedhelicopter
11-08-2007, 02:26 PM
A good way might be to look at a sheet change event and check for formula there, resetting any that are found.

skaswani
11-08-2007, 02:35 PM
:s
how?

unmarkedhelicopter
11-09-2007, 02:53 AM
If I gave you some code would you be able to put it in a spreadsheet ?
Are you happy working in the VBA IDE ?
Or do you want to post your spreadsheet and I could put it in there ?
Do you want to remove formula on ALL sheets or just 1 ?

Bob Phillips
11-09-2007, 05:13 AM
Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit
Application.EnableEvents = False

If Target.HasFormula Then
Target.Value = ""
End If

ws_exit:
Application.EnableEvents = True
End Sub


This is worksheet event code, which means that it needs to be
placed in the appropriate worksheet code module, not a standard
code module. To do this, right-click on the sheet tab, select
the View Code option from the menu, and paste the code in.

skaswani
11-09-2007, 06:33 AM
oh lovely
gr8, thanks :)