how do i restrict cells to not accept formulas?

D

Don Guillett

Right click sheet tab>view code insert this>you may want to restrict the
area??

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.HasFormula = True Then Target = ""
End Sub
or
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.HasFormula = True Then
MsgBox "No formulas allowed"
Target = ""
End If
End Sub
 
D

Don Guillett

Or this to convert their formula to a value

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.HasFormula = True Then
Target.Value = Target
msgbox "Your formula has been converted to a value"
End If
End Sub
 
R

ryguy7272

Well, I guess you could use Data Validation. Data > Validation > Custom > in
the rectangle, put this: =$C$1.

In Cell C1, enter this: <>=

Try that and see how you get along.

HTH,
Ryan---
 

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

Top