ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Automatic adding in a single cell w/o equal sign (https://www.excelbanter.com/excel-worksheet-functions/225915-automatic-adding-single-cell-w-o-equal-sign.html)

Jacky

Automatic adding in a single cell w/o equal sign
 
how do I automatically in a single cell input 5+5 without the equal sign and
have a total come up

Gary''s Student

Automatic adding in a single cell w/o equal sign
 
Let's use cell B9 as an example. Insert the following event macro in the
worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range
Set r = Range("B9")
v = r.Value
If Intersect(r, Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
r.Value = Evaluate(v)
Application.EnableEvents = True
End Sub


Because it is worksheet code, it is very easy to install and automatic to use:

1. right-click the tab name near the bottom of the Excel window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you have any concerns, first try it on a trial worksheet.

If you save the workbook, the macro will be saved with it.


To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu200841


"jacky" wrote:

how do I automatically in a single cell input 5+5 without the equal sign and
have a total come up


Jacky

Automatic adding in a single cell w/o equal sign
 
Thank you for the information Gary, however; I need to do this in several
cells where i am able to add in the individual cell. Can you help

"jacky" wrote:

how do I automatically in a single cell input 5+5 without the equal sign and
have a total come up


Gary''s Student

Automatic adding in a single cell w/o equal sign
 
Tell me about the cells. Are they in some column or row ??
--
Gary''s Student - gsnu200842


"jacky" wrote:

Thank you for the information Gary, however; I need to do this in several
cells where i am able to add in the individual cell. Can you help

"jacky" wrote:

how do I automatically in a single cell input 5+5 without the equal sign and
have a total come up


Jacky

Automatic adding in a single cell w/o equal sign
 
I just want capability to be able to add numbers in each cell using the
keyboard for example:

5+5 then enter button will give me 10
I would like to do that in each cell.

"Gary''s Student" wrote:

Tell me about the cells. Are they in some column or row ??
--
Gary''s Student - gsnu200842


"jacky" wrote:

Thank you for the information Gary, however; I need to do this in several
cells where i am able to add in the individual cell. Can you help

"jacky" wrote:

how do I automatically in a single cell input 5+5 without the equal sign and
have a total come up


Jacky

Automatic adding in a single cell w/o equal sign
 
I want to be able to add several numbers in each cell w/o equal sign.

5+5+6 and have the total come up when i press enter on the keyboard.
thanks

"Gary''s Student" wrote:

Tell me about the cells. Are they in some column or row ??
--
Gary''s Student - gsnu200842


"jacky" wrote:

Thank you for the information Gary, however; I need to do this in several
cells where i am able to add in the individual cell. Can you help

"jacky" wrote:

how do I automatically in a single cell input 5+5 without the equal sign and
have a total come up


John[_22_]

Automatic adding in a single cell w/o equal sign
 
Hi Jacky
Maybe this will help if I understand your question.
If you use a lot your numeric keypad for your calculations, start with a + on
the keypad instead of the = sign, e.g. +5+5-5, +5*5.etc. The + sign is handy
right beside your numbers.
You should know that in the future, Microsoft will stop using that function and
you will need to use the = sign.
Its a backward compatibility with Lotus123 and is no longer used.

HTH
John

"jacky" wrote in message
...
I want to be able to add several numbers in each cell w/o equal sign.

5+5+6 and have the total come up when i press enter on the keyboard.
thanks

"Gary''s Student" wrote:

Tell me about the cells. Are they in some column or row ??
--
Gary''s Student - gsnu200842


"jacky" wrote:

Thank you for the information Gary, however; I need to do this in several
cells where i am able to add in the individual cell. Can you help

"jacky" wrote:

how do I automatically in a single cell input 5+5 without the equal sign
and
have a total come up



Gary''s Student

Automatic adding in a single cell w/o equal sign
 
Here is a small variation of the code I posted before. Be sure you delete
the old code before installing this version:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range
Set r = Target
v = r.Value
Application.EnableEvents = False
r.Value = Evaluate(v)
Application.EnableEvents = True
End Sub
--
Gary''s Student - gsnu200842


"jacky" wrote:

I want to be able to add several numbers in each cell w/o equal sign.

5+5+6 and have the total come up when i press enter on the keyboard.
thanks

"Gary''s Student" wrote:

Tell me about the cells. Are they in some column or row ??
--
Gary''s Student - gsnu200842


"jacky" wrote:

Thank you for the information Gary, however; I need to do this in several
cells where i am able to add in the individual cell. Can you help

"jacky" wrote:

how do I automatically in a single cell input 5+5 without the equal sign and
have a total come up


Jacky

Automatic adding in a single cell w/o equal sign
 
thank you Gary, exactly what I need, you are a pro.

"Gary''s Student" wrote:

Here is a small variation of the code I posted before. Be sure you delete
the old code before installing this version:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range
Set r = Target
v = r.Value
Application.EnableEvents = False
r.Value = Evaluate(v)
Application.EnableEvents = True
End Sub
--
Gary''s Student - gsnu200842


"jacky" wrote:

I want to be able to add several numbers in each cell w/o equal sign.

5+5+6 and have the total come up when i press enter on the keyboard.
thanks

"Gary''s Student" wrote:

Tell me about the cells. Are they in some column or row ??
--
Gary''s Student - gsnu200842


"jacky" wrote:

Thank you for the information Gary, however; I need to do this in several
cells where i am able to add in the individual cell. Can you help

"jacky" wrote:

how do I automatically in a single cell input 5+5 without the equal sign and
have a total come up


Jacky

Automatic adding in a single cell w/o equal sign
 
Thank you John, also very helpful and good to know.

"John" wrote:

Hi Jacky
Maybe this will help if I understand your question.
If you use a lot your numeric keypad for your calculations, start with a + on
the keypad instead of the = sign, e.g. +5+5-5, +5*5.etc. The + sign is handy
right beside your numbers.
You should know that in the future, Microsoft will stop using that function and
you will need to use the = sign.
Its a backward compatibility with Lotus123 and is no longer used.

HTH
John

"jacky" wrote in message
...
I want to be able to add several numbers in each cell w/o equal sign.

5+5+6 and have the total come up when i press enter on the keyboard.
thanks

"Gary''s Student" wrote:

Tell me about the cells. Are they in some column or row ??
--
Gary''s Student - gsnu200842


"jacky" wrote:

Thank you for the information Gary, however; I need to do this in several
cells where i am able to add in the individual cell. Can you help

"jacky" wrote:

how do I automatically in a single cell input 5+5 without the equal sign
and
have a total come up




John[_22_]

Automatic adding in a single cell w/o equal sign
 
Hi Jacky
You're welcome
John
"jacky" wrote in message
...
Thank you John, also very helpful and good to know.

"John" wrote:

Hi Jacky
Maybe this will help if I understand your question.
If you use a lot your numeric keypad for your calculations, start with a + on
the keypad instead of the = sign, e.g. +5+5-5, +5*5.etc. The + sign is handy
right beside your numbers.
You should know that in the future, Microsoft will stop using that function
and
you will need to use the = sign.
Its a backward compatibility with Lotus123 and is no longer used.

HTH
John

"jacky" wrote in message
...
I want to be able to add several numbers in each cell w/o equal sign.

5+5+6 and have the total come up when i press enter on the keyboard.
thanks

"Gary''s Student" wrote:

Tell me about the cells. Are they in some column or row ??
--
Gary''s Student - gsnu200842


"jacky" wrote:

Thank you for the information Gary, however; I need to do this in
several
cells where i am able to add in the individual cell. Can you help

"jacky" wrote:

how do I automatically in a single cell input 5+5 without the equal
sign
and
have a total come up






All times are GMT +1. The time now is 08:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com