makro that sums every new number entered in cell

my problem:
i want to enter a number in A1
and everytime when u enter a number in a1 the macro adds the new number to
the old one BUT in the end there sould be the hole thing in the cell as
code...


A1                             A1 - 0
input "14" in A1        A1 - 14
input "10" in A1       A1 - 24
input "-2" in A1       A1 - 22

at the end  A1 =   "14 + 10 - 2 "  = 22

so that u can controll what is typed in

kind regards
mario



0
mmc_vw1200 (10)
10/29/2003 6:30:12 PM
excel 39879 articles. 2 followers. Follow

2 Replies
546 Views

Similar Articles

[PageSpeed] 41

Mario,

Although this can be done, reconsider.  The cell would eat up what you've
typed in, and you'll have no way of knowing what's been typed in and what
hasn't.  Good practice is to put the entries in a list (often with
identifying information, like date, invoice number, whateer), and SUM the
list.

-- 
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Mario" <mmc_vw1200@hotmail.com> wrote in message
news:3fa00cf1$0$20884$91cee783@newsreader02.highway.telekom.at...
> my problem:
> i want to enter a number in A1
> and everytime when u enter a number in a1 the macro adds the new number to
> the old one BUT in the end there sould be the hole thing in the cell as
> code...
>
>
> A1                             A1 - 0
> input "14" in A1        A1 - 14
> input "10" in A1       A1 - 24
> input "-2" in A1       A1 - 22
>
> at the end  A1 =   "14 + 10 - 2 "  = 22
>
> so that u can controll what is typed in
>
> kind regards
> mario
>
>
>


0
nowhere8060 (363)
10/29/2003 7:40:52 PM
Actually, I think the OPs proposal would preserve the data. Here's 
one way:

Put this in the worksheet code module (right-click on the worksheet 
tab, choose View Code, paste the code in the window that  opens, 
then click the XL icon on the toolbar to return to XL):


    Option Explicit
    Dim gvOldFormula As Variant
    
    Private Sub Worksheet_Activate()
        With Range("A1")
            If .HasFormula Then
                gvOldFormula = .Formula
            Else
                gvOldFormula = "="
            End If
        End With
    End Sub
    
    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
        With Target
            If .Count > 1 Then Exit Sub
            If .Address(False, False) = "A1" Then
                If IsNumeric(.Value) Then
                    Application.EnableEvents = False
                    .Value = gvOldFormula & "+" & .Value
                    Application.EnableEvents = True
                    gvOldFormula = .Formula
                End If
            End If
        End With
    End Sub







In article <OVmzSSlnDHA.2512@TK2MSFTNGP09.phx.gbl>,
 "Earl Kiosterud" <nowhere@verizon.net> wrote:

> 
> Although this can be done, reconsider.  The cell would eat up what you've
> typed in, and you'll have no way of knowing what's been typed in and what
> hasn't.  Good practice is to put the entries in a list (often with
> identifying information, like date, invoice number, whateer), and SUM the
> list.
0
jemcgimpsey (6723)
10/29/2003 9:22:08 PM
Reply:

Similar Artilces:

auto sum a group of numbers
I use Excel to figure interest earned each year on a number of funds for our church. I have devised a formala to calculate and divide the amount of interest earned in a given amount of days. However, when I use the autosum function, my total is off by one cent, being one cent too low. Thanks for any help you might b able to provide. 6/30/2003 6/30/2003 $$ DAYS 2003 INT ROUNDED 12/31/2003 INT ON as of 12/31/03 BALANCES THIS COL DAYS TO USE 185 INTEREST TO DIVIDE 53.52 GENERAL FUND 189.56 189.56 ...

Copy paste from Access to Excel, numbers pasted as text
Numbers from Access paste as text to Excel in the following environment: Windows XP SP1 Access 2002 SP3 Excel 2002 SP3 The table stores the amounts in question as Numbers. Under Windows 2000 SP4, the numbers paste fine. Besides Exporting, is there a way to fix the problem? It is simpler to copy and paste than export if the dataset is small. Dig You may want to read Debra Dalgleish's site: http://www.contextures.com/xlDataEntry03.html Especially: http://www.contextures.com/xlDataEntry03.html#SP3 Dig314 wrote: > > Numbers from Access paste as text to Excel in the follow...

New/old problem with Powerpoint in Update 2
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel When MS Office 2008 first came out, Powerpoint was unable to open files created by Powerpoint 2004. This was fixed in Update 1. Update 2 brings the problem back. I cannot open presentations that I created just a few days ago in Powerpoint. This is a MAJOR problem for me. I'm developing several courses and need access to those materials. The first time this occurred I was able to open the presentations using Keynote. Unfortunately I have to send these courses to the university for more processing so that's not ...

Numbers won't "SUM" from YAHOO
I have copied the chart of monthly messsage total from YAHOO groups in order to make a chart. On YAHOO they are hyperlinks to the messages of that month and appear and behave in EXCEL as hyperlinks. I have vopied the hyperlinks to my NOTETAB text editor which leaves me with text only, tab separated. The cells are formatted as numbers. I have pasted the result into a sheet and the totals appear as text. I cannot sum the rows or columns. The result is zero. In one case I inadvertantly included the row heading "year date" and that was in the result. So there is still some formatti...

fill cells
Hi, I need to make more visual our staffing plan. Have a table, the first coloumn contains time with an inerval of 00:30, like: 06:00 06:30 .... 20:30 21:00 I neet to find a way to fill the cells eg. between 8:00 and 17:30 that depend on the staff plan and are stored (changed) in two cells. Has anybody an idea how to do this? Thanks, Marton Hi Marton if you'ld like to email me direct (julied_ng at hcts dot net dot au) i'll be happy to send you a sample worksheet that does this which you can then customise for your purposes. Cheers JulieD "VilMarci" <dontsen...

Make Cells Diagonal
How do I make the top "label row" of the columns diagonal (45 degree angle) instead of horizontal. I have seen it done but don't know how to do it. Thank you. ...

Windows7 and new motherboard or hard drive
Can you use the same retail copy of Windows 7 to do a re-install if you get a new motherboard or hard drive? I am not clear on this licience thing with Microsoft. Thank you, David titus12 wrote: > Can you use the same retail copy of Windows 7 to do a re-install if you get > a new motherboard or hard drive? I am not clear on this licience thing with > Microsoft. Well, you should ask in the Win7 newsgroup, rather than the WinXP one. I've changed several hard drives and motherboards on my XP system, and it never asked for a reactivation. I expect Win7 is th...

Maximum number of process....Windows
Hi, Is there any limit of number of process or thread that can run at a time in Win9X and win2k/XP OS. Plz reply. regds vinay Well, on the toy systems (Win9x), the process limit is fairly small, probably reasonably on the order of a few hundred, but I've never measured it. The limit is based on the available real memory, the available paging space, the amount of GDI space, the number of windows, etc. (the USER and GDI space is shared system-wide under MS-DOS), and, or course, the sizes of the processes. On real operating systems, you will probably run out of patience before you r...

Sum Trouble
I want to sum only data in my report that falls between the form dates...everytime I try to "Sum" , it says it's too complex. Do you see a better way? The goal of the report is to show ALL mandatory trainings (no matter the date) and all other trainings that took place with in the form start and end dates. I need it to show the total hours earned within the form dates as well. My IIf statement shows correctly under the detail section but I cannot get the total in the employee footer. IIf(Eval([Completed] Between [Forms]![frmDateSelect]![Start] And [Forms]...

How do I enter a field with the current time + six hours?
I am making a macro for printing medication labels. I need to have an expiration time on the label and would like it to be the current time + 6 hours. How can I structure the field to do this? I would put a { docvariable exptime } field in the label where you want the time to appear and in your code use With ActiveDocument .Variables("exptime").Value = Format(DateAdd("h", 6, Now), "h:mm am/pm") .Range.Fields.Update .PrintOut End With You must use Ctrl+F9 to insert the field delimiters around the docvariable field and use Alt+F9 to t...

How do I copy part of each cell in a column?
I have a column of data - ie: (1APB-0101) BFP Motor Valve I want to copy the information in ( ) to another column. How can I do this? =MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1) and fill down "I should know this!" <I should know this!@discussions.microsoft.com> wrote in message news:6DF67909-D5BF-4F62-A9FE-0AFB6C979279@microsoft.com... > I have a column of data - ie: (1APB-0101) BFP Motor Valve > I want to copy the information in ( ) to another column. > How can I do this? > One way: If all the items inside parens in th...

Auto Numbering
I'm trying to set-up an invoice using thr Sales invoice template on excel, is there any way that, every time you open the invoice worksheet that it auotmatically count's up 1 Below is a post I found by Frank Kabel. It might be just what you need: **** one way (using the Windows registry for storing the last number). Put the following code in the workbook module (not in a standard module) of your template: - It changes cell A1 of the first sheet - you may change the key identifiert according to your needs (e.g. DEFAULTSTART, MYLOCATION, etc.) Private Sub Workbook_Open() Cons...

PowerEdit
Dear all, I would like to let you know I have added another freeware Excel add-in called 'PowerEdit' to my website . Information about this add-in and a download link is available from: http://www.johnmote.com/poweredit.htm Many thanks, John -------- an abstract of the add-in functionality from the website is included below for your convenience -------- Overview of PowerEdit functionality What is PowerEdit? PowerEdit is an add-in for Microsoft Excel that provides additional copy and paste functionality Excel. The additional functionality includes: =B7 Exact formula copies...

Undeliverable Email after making a new meeting request
I have an interesting problem going on and would like feedback from anyone who can help. We are running Outlook 2003 with an Exchange 2003 Enterprise server. I had a former employee Mary Jo who was given right to view the exchange calendar of her boss and assist him with his scheduling. She left the company and a new employee took her place. Her domain account and email account were deleted from the server. Here is where it gets interesting. Now whenever a user in Outlook submits a new meeting request to her boss by selecting the boss's email from the global address list from withi...

Sum If ???
when I copy an excel file that contains sum if equations many cells in this file are corrupted when they are copied to another computer. can you please tell me a solution for this problem ??? My mail is: ahmed.saad@ymail.com Best Regards Ahmed Saad Is it SUMIFS formulae created in Excel 2007 being used in Excel 2003 by any chance? -- HTH Bob "Ahmed saad" <Ahmed saad@discussions.microsoft.com> wrote in message news:FA728A35-FECA-4DAD-884B-119FD8001FEB@microsoft.com... > when I copy an excel file that contains sum if equations many cells ...

customer loyalty
does anyone have a recomendation for how to handle this type of loyalty program? Simply we were thinking we could generate a report that shows all customers with sales over $300 and then manually assign them vouchers but this could be time consumming. Also - how do you give a customer a gift voucher - you would have to sell it to them to track it voucher # at redemption but how do you sell it without selling it? Any thoughts? all the loyalty programs I have found are based on points. My customer wants it simply based on net sales. There is a customer loyalty addon that supports thi...

How may I macro update a normal distribution chart from new data?
In Excel 2003 SP2. I have created a form for reporting Statistical values.This includes a normal distribution chart. I want to update this chart when new sample data is entered into the form, without having to go through "Tools, Data Analysis, Histogram" each time. I have already tried recording my steps, with "Record New Macro" in the tools menu, but this does not work. The histogram is plotted from a table of bin ranges and counts. If you change those table values into formulas, then the histogram will update with those formulas. Jerry "Mike Williams"...

Problem creating new mailbox
Hello, I'm trying to create a new mailbox, I've done this tons of times but this time I'm getting a problem. I created the user and then the respective mailbox with no problems. I then went to the users properties to create e email address, choose SMTP and inserted the address with no problems. The other times after some seconds exchange would automatically create de X400 Address but this time it doesn't, the user won't appear in the global address list and when I configure Outlook 2003 and click "check name" it says it cannot find the user. Last friday I cr...

Newbie question
Hi, Is there a way to flag selected cell ranges to always stay together when they print? In Word they have a "keep lines together" option -- is there anything comparable in Excel to ensure that selected cells/rows stay together on a page even when new information is added (not only within the selected range but also when additional cell ranges are added)? I need to ensure that the cell ranges aren't split by page breaks. I currently use print preview to see where they are breaking once I add new information and then move the page breaks before printing. Since new...

Deliver new e-mail to the following location
Hi, Is it possible to disable the feature "Deliver new e-mail to the following location" in outlook? In other word, disable to possibility to work with a PST file from outlook. Thanks in advance, Laurent Laur wrote: > Hi, > > Is it possible to disable the feature "Deliver new e-mail to the > following location" in outlook? In other word, disable to possibility > to work with a PST file from outlook. > > Thanks in advance, > > Laurent See http://www.winnetmag.com/MicrosoftExchangeOutlook/Article/ArticleID/40961/MicrosoftExchangeOutlook_40961...

Migrate to new Hardware
We are in the process of Migrating to new hardware from current hardware. I found a document on Great Plains web site that I have to create each comapny and then restore the databases from the old machine. Why we have to create companies on the new machine? If you restore Master and all Great Plains databases everything should be fine. I am guessing there should be a reason why Great Plains is suggesting to create and restore the databases. When you restore it what ever is done by the new installation is overwritten with the restore. Does it update any table with Hardware configuration...

New messages in Inbox, and I haven't been in my email???
The past few days I have opened my email and there are messages already received (bolded as unread). It makes me suspicious that someone has been into my email, but I'm not sure. Are there any other explanations? Any ways for emails to hit my inbox without the program being opened? Which email program do you use? Is it configured to check for new messages at startup, or automatically every X minutes? --=20 Gary VanderMolen, Microsoft MVP (Mail) http://mvp.support.microsoft.com/default.aspx/profile/vandermolen "farley" <farley@discussions.microsoft.com>...

Why must I click on my inbox shortcut to see new incoming mail?
First, the email account I have chosen for default doesnt' come up when I open Outlook. I must click on its inbox shortuct. Second, my incoming notification doesn't work (envelope in tray, sound, nothing). New incoming mail doesn't show up in my inbox unless I click again (similar to refresh) on the inbox shortcut????? On Thu, 16 Feb 2006 21:47:26 -0800, "paul" <paul@discussions.microsoft.com> wrote: >First, the email account I have chosen for default doesnt' come up when I >open Outlook. I must click on its inbox shortuct. > >Second, my incom...

Receive Mai in Outlookl -> Execute Excel Makro
Dear all How can I run an already existing Excel (2002) macro on an open Excel worksheet after I receive a certain type of e-mail (e.g. all mails with a specific subject)? Thanks for your help Regards, Reto ...

Sum and If
I am wanting to add numbers in Column B,d,f etc only if it equals the text in Column A,c,e etc -- Shirl, NZ hi try this.. =SUMIF(B2:B8,"text",A2:A8) or sumif(range with criteria, criteria, range to sum) Regards FSt1 "Shirl" wrote: > I am wanting to add numbers in Column B,d,f etc only if it equals the text in > Column A,c,e etc > -- > Shirl, NZ I might be overlooking the obvious, but how can NUMBERS in a column equal TEXT in another column? Regards, Howard "Shirl" <Shirl@discussions.microsoft.com> wrote in me...