#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default Accumulator

Hello,

It would seem what I was looking for all this time was called an accumulator.

Is there some way to alter the code below to link up to a page in another
workbook?

In other words, a number would be typed in sheet 1 of another work book and
this formula would take that number and add it and total it all the while
keeping the running total.

Thank you muchly.

-Bad



Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Address(False, False) = "A1" Then
If IsNumeric(.Value) Then
Application.EnableEvents = False
Range("B1").Value = Range("B1").Value + .Value
Application.EnableEvents = True
End If
End If
End With
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Accumulator

This line:
Range("B1").Value = Range("B1").Value + .Value
says to add the value to B1 of the same sheet.

So

worksheets("someothersheet").Range("B1").Value _
= worksheets("someothersheet").Range("B1").Value + .Value

BadBoy wrote:

Hello,

It would seem what I was looking for all this time was called an accumulator.

Is there some way to alter the code below to link up to a page in another
workbook?

In other words, a number would be typed in sheet 1 of another work book and
this formula would take that number and add it and total it all the while
keeping the running total.

Thank you muchly.

-Bad

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Address(False, False) = "A1" Then
If IsNumeric(.Value) Then
Application.EnableEvents = False
Range("B1").Value = Range("B1").Value + .Value
Application.EnableEvents = True
End If
End If
End With
End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default Accumulator

Good morning,

You Sir, my wife will have your children!

Thank you very much for the response. (Insert happy face here)

-Bad

"Dave Peterson" wrote:

This line:
Range("B1").Value = Range("B1").Value + .Value
says to add the value to B1 of the same sheet.

So

worksheets("someothersheet").Range("B1").Value _
= worksheets("someothersheet").Range("B1").Value + .Value

BadBoy wrote:

Hello,

It would seem what I was looking for all this time was called an accumulator.

Is there some way to alter the code below to link up to a page in another
workbook?

In other words, a number would be typed in sheet 1 of another work book and
this formula would take that number and add it and total it all the while
keeping the running total.

Thank you muchly.

-Bad

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Address(False, False) = "A1" Then
If IsNumeric(.Value) Then
Application.EnableEvents = False
Range("B1").Value = Range("B1").Value + .Value
Application.EnableEvents = True
End If
End If
End With
End Sub


--

Dave Peterson

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
Accumulator Logic peyman Excel Discussion (Misc queries) 7 October 17th 07 11:13 PM
accumulator with other than one dan Excel Worksheet Functions 8 November 24th 06 06:29 PM
Need help with two cell accumulator dlashley Excel Worksheet Functions 1 May 12th 06 11:02 AM
Two cell accumulator Bill Excel Worksheet Functions 4 August 21st 05 09:07 PM
Two cell accumulator Bill Excel Worksheet Functions 1 January 3rd 05 03:15 PM


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

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"