A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

AUTO ADDITION



 
 
Thread Tools Display Modes
  #1  
Old March 11th, 2004, 04:30 PM
external usenet poster
 
Posts: n/a
Default AUTO ADDITION

I AM LOOKING FOR A WAY TO HAVE EXCEL AUTOMATICALLY DO
SOME MATH FOR ME. FOR EXAMPLE, IF I TYPE 25 IN CELL B4, I
WANT IT TO AUTOMATICALLY ADD 25 TO IT. ANY THOUGHTS?

THANKS YOU FOR YOUR TIME.

  #2  
Old March 11th, 2004, 04:47 PM
Frank Kabel
external usenet poster
 
Posts: n/a
Default AUTO ADDITION

Hi
do you want the result in the same cell (that is the value 50 placed in
cell B4?) or is a separate cell sufficient?. for the latter one you can
simply use the formula
=B4+25
placed for example in cell C4

For storing the result in the same cell an event procedure is required
but I would try to use a helper cell. Post back if this is not
sufficient for you


--
Regards
Frank Kabel
Frankfurt, Germany

wrote:
I AM LOOKING FOR A WAY TO HAVE EXCEL AUTOMATICALLY DO
SOME MATH FOR ME. FOR EXAMPLE, IF I TYPE 25 IN CELL B4, I
WANT IT TO AUTOMATICALLY ADD 25 TO IT. ANY THOUGHTS?

THANKS YOU FOR YOUR TIME.


  #3  
Old March 11th, 2004, 06:56 PM
external usenet poster
 
Posts: n/a
Default AUTO ADDITION

I WOULD LIKE TO KEEP IT IN THE SAME CELL IF POSSIBLE. I
HAVE NO IDEA HOW TO DO AN EVENT PROCEDURE. I'M GUESSING BY
HELPER CELL YOU MEAN STORE IT IN ANOTHER CELL?
-----Original Message-----
Hi
do you want the result in the same cell (that is the

value 50 placed in
cell B4?) or is a separate cell sufficient?. for the

latter one you can
simply use the formula
=B4+25
placed for example in cell C4

For storing the result in the same cell an event

procedure is required
but I would try to use a helper cell. Post back if this

is not
sufficient for you


--
Regards
Frank Kabel
Frankfurt, Germany

wrote:
I AM LOOKING FOR A WAY TO HAVE EXCEL AUTOMATICALLY DO
SOME MATH FOR ME. FOR EXAMPLE, IF I TYPE 25 IN CELL B4,

I
WANT IT TO AUTOMATICALLY ADD 25 TO IT. ANY THOUGHTS?

THANKS YOU FOR YOUR TIME.


.

  #4  
Old March 11th, 2004, 07:06 PM
Frank Kabel
external usenet poster
 
Posts: n/a
Default AUTO ADDITION

Hi
first: please tun-off your CAPS lock. It's difficult to read and
considered as SHOUTING in newsgroups :-)

To your questions:
1. Helper cell: Yes this would be another cell
2. If you want to have this value in the same cell you have to use VBA.
The following code has to go in your worksheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.count 1 Then Exit Sub
If Intersect(Target, Me.Range("B4")) Is Nothing Then Exit Sub
On Error GoTo CleanUp:
With Target
if .value "" and isnumeric(.value) then
Application.EnableEvents = False
.value = .value +25
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub


For more information about these event procedures take a look at:
http://www.cpearson.com/excel/events.htm

--
Regards
Frank Kabel
Frankfurt, Germany

wrote:
I WOULD LIKE TO KEEP IT IN THE SAME CELL IF POSSIBLE. I
HAVE NO IDEA HOW TO DO AN EVENT PROCEDURE. I'M GUESSING BY
HELPER CELL YOU MEAN STORE IT IN ANOTHER CELL?
-----Original Message-----
Hi
do you want the result in the same cell (that is the value 50 placed
in cell B4?) or is a separate cell sufficient?. for the latter one
you can simply use the formula
=B4+25
placed for example in cell C4

For storing the result in the same cell an event procedure is
required but I would try to use a helper cell. Post back if this is
not sufficient for you


--
Regards
Frank Kabel
Frankfurt, Germany

wrote:
I AM LOOKING FOR A WAY TO HAVE EXCEL AUTOMATICALLY DO
SOME MATH FOR ME. FOR EXAMPLE, IF I TYPE 25 IN CELL B4, I
WANT IT TO AUTOMATICALLY ADD 25 TO IT. ANY THOUGHTS?

THANKS YOU FOR YOUR TIME.


.


  #5  
Old March 11th, 2004, 07:07 PM
Bernie Deitrick
external usenet poster
 
Posts: n/a
Default AUTO ADDITION

Copy the code below, right click on the sheet tab, select view code, and
paste the code in the window that appears. This code will apply your
desired behavior to cells B2:B10, if they are changed one at a time.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myVal As Variant

If Target.Cells.Count 1 Then Exit Sub

Application.EnableEvents = False
If Not (Intersect(Range("B2:B10"), Target) Is Nothing) Then
myVal = Target.Value
Application.Undo
Target.Value = Target.Value + myVal
End If
Application.EnableEvents = True

End Sub

wrote in message
...
I AM LOOKING FOR A WAY TO HAVE EXCEL AUTOMATICALLY DO
SOME MATH FOR ME. FOR EXAMPLE, IF I TYPE 25 IN CELL B4, I
WANT IT TO AUTOMATICALLY ADD 25 TO IT. ANY THOUGHTS?

THANKS YOU FOR YOUR TIME.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:12 PM.


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