Update Excel Cell Value

Dancaw

New Member
Joined
Apr 7, 2009
Messages
18
Hi,

Is it possible to update an existing cell value when i add the new value it adds it to the existing valve I imput?

Example

Paul A1 = 55 I Over type 55 with say 16, when i press enter i want it to say 71 and not 16, is it doable?

Cheers

Dan
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Try this: right click the sheet tab, select View Code and paste in

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x
If Target.Address(False, False) = "A1" Then
    x = Target.Value
    Application.EnableEvents = False
    Application.Undo
    Target.Value = Target.Value + x
    Application.EnableEvents = True
End If
End Sub

then try entering numbers in A1.
 
Upvote 0
Hi,

Thank you for a Super Quick Response,

How do i change the code to work on a range of cells eg

AN1: AN20

Tried doing "AN1":"AN20" and "AN1:20" but no luck.
 
Upvote 0
Try

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("AN1:AN20")) Is Nothing Then
    x = Target.Value
    Application.EnableEvents = False
    Application.Undo
    Target.Value = Target.Value + x
    Application.EnableEvents = True
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,278
Members
452,902
Latest member
Knuddeluff

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