View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Command to change the value of a cell within same cell

Right click the sheet tabview codecopy/paste all of this. Now when you
enter a number in a5 it will do as desired. To start over enter a zero


Option Explicit
Dim oldvalue As Double

Private Sub Worksheet_Change(ByVal target As Excel.Range)
If target.Address = "$A$5" Then
On Error GoTo fixit
Application.EnableEvents = False
If target.Value = 0 Then oldvalue = 0
target.Value = 1 * target.Value + oldvalue
oldvalue = target.Value
fixit:
Application.EnableEvents = True
End If
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

" wrote in
message ...
I know it's rather hard to describe but I'll try. Say you have values in
Column A to which you want to add $50 to. Rather than inserting a formula
in
a different column of =A1+50, I want to insert the command to increase the
cell in Column A by 50 directly with the cell itself. Again, I thought I
saw
this done somewhere, which I obviously can't recall. I realize there are
work arounds, I just happen to have a situation where my preference would
be
not have to have insert another column to increase the value of cells in
an
existing column.

"ShaneDevenshire" wrote:

A formula changes the cell value in the same cell when it recalculates.

I think you are going to need to be more specific, why not give us an
example of what you mean.
--
Thanks,
Shane Devenshire


" wrote:

I recently saw a command (symbol) which allows you to change the value
of a
cell within the same cell. Opposed to inserting separate column with a
formula. Is anyone familiar with this or was I dreaming?