Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default macro adding a number to a number already in a cell

right click on sheet tabview codeinsert thissave workbook
'========
Option Explicit
Dim oldvalue As Double
'Below works
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$A$5" Or Target.Address = "$B$5" Then
Application.EnableEvents = False
If Target.Value = 0 Then oldvalue = 0
' don't want the following line to create a loop
Target.Value = 1 * Target.Value + oldvalue
oldvalue = Target.Value
Application.EnableEvents = True
End If
End Sub

Sub Fixit()'Use this if above stops working
Application.EnableEvents = True
End Sub
'==========


"Todd" wrote in message
...
I am entering numbers like "5.725" into a cell next to a
given part number.

then later on I might come back to the same cell and need
to enter and additional amount like 4.5

so I need to hit the = sign and get the cell to
say "=5,725+4.5 becuase I need to see the detail behind
the total of the cell.

can a macro be made that will take me to edit mode simular
to f2 but will automatically put the = in front of the
original number then jump to the right of it place a + and
be ready for me to type the 2nd value

so :

go to a cell with a number already in it

hit the macro

get my cursor blinking for data entry with the original
number still intact and an = to the left of it and a + to
the right of the original number

=5.725+"I type the new number here and hit the green check

thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding to number to get the cell Maracay Excel Discussion (Misc queries) 4 January 1st 10 10:32 AM
Adding number within a cell Jon A Excel Worksheet Functions 5 February 4th 08 04:06 PM
Adding a number to a cell that already has a number. paula Excel Discussion (Misc queries) 3 January 15th 08 04:41 PM
adding number in next cell ED New Users to Excel 4 January 11th 06 09:44 PM
macro adding a number to a number already in a cell Ron de Bruin Excel Programming 0 October 17th 03 04:59 PM


All times are GMT +1. The time now is 06:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"