Unable to delete code in worksheet cell

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Morning.
I have a code in column E cells & down the page but i am unable to delete / change it
Pressing delete etc doesnt do anything.
If i select the cell & put the new code in the address bar above also makes no difference.

Can you advise how this cell is locked please.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Forgot to mention I selected the cells and selected format then protection tab and removed the tick.
Saved workbook and closed.
opened file and still the code is there and unable to be deleted.
 
Upvote 0
To better understand what you mean I suggest you share a sample workbook that have the problem
Bye
 
Upvote 0
Here is the file


I wish to delete the current code for sheet tab INCOME 2 cells E5:E28

I then wish to place the code below in its place.

Rich (BB code):
=IF(C5="","",IF(ISERROR(C5+D5),"",C5+D5))
 
Upvote 0
maybe replace formula here
Rich (BB code):
'Private Sub Worksheet_Change(ByVal Target As Range)
'  If Not Intersect(Target, Range("E4:E30")) Is Nothing Then
'    Application.EnableEvents = False
'    Range("E4:E30").Formula = "=IF(C4="""","""",C4+D4)"
'    Application.EnableEvents = True
'  End If
'
''   Exit if more than one cell updated at a time
'    If Target.Count > 1 Then Exit Sub
'
''   Check to see if value updated is in column B or D
'    If Target.Column = 2 Or Target.Column = 3 Then
'        Application.EnableEvents = False
'        If UCase(Cells(Target.Row, "B")) = "REFUND" Then
'            Cells(Target.Row, "C") = Abs(Cells(Target.Row, "C")) * -1
'        Else
'            If Cells(Target.Row, "B") = "" Then Cells(Target.Row, "C").ClearContents
'        End If
'        Application.EnableEvents = True
'    End If
'    If Not (Application.Intersect(Target, Range("A3:G28")) _
'      Is Nothing) Then
'        With Target
'            If Not .HasFormula Then
'                Application.EnableEvents = False
'                .Value = UCase(.Value)
'                Application.EnableEvents = True
'            End If
'        End With
'    End If
'
'End Sub
 
Upvote 0
Hi
Replace with this part

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  If Not Intersect(Target, Range("E5:E28")) Is Nothing Then
    Application.EnableEvents = False
    Range("E5:E28").Formula = "=IF(C5="""","""",IF(ISERROR(C5+D5),"""",C5+D5))"
    Application.EnableEvents = True
  End If
 
Upvote 0
Solution

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top