ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how do i restrict cells to not accept formulas? (https://www.excelbanter.com/excel-worksheet-functions/247040-how-do-i-restrict-cells-not-accept-formulas.html)

John

how do i restrict cells to not accept formulas?
 
Is there a way to restrict cells in excel so that formulas cannot be typed
into them?

Don Guillett

how do i restrict cells to not accept formulas?
 
Right click sheet tabview code insert thisyou 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
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"John" wrote in message
...
Is there a way to restrict cells in excel so that formulas cannot be typed
into them?



Don Guillett

how do i restrict cells to not accept formulas?
 
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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
Right click sheet tabview code insert thisyou 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
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"John" wrote in message
...
Is there a way to restrict cells in excel so that formulas cannot be
typed
into them?




ryguy7272

how do i restrict cells to not accept formulas?
 
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---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"John" wrote:

Is there a way to restrict cells in excel so that formulas cannot be typed
into them?



All times are GMT +1. The time now is 11:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com