Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default adding a cell to a cell keeping a running total please help


im having a bit of trouble with this coding i want to add a value of one
to a cell to keep a running total no matter what number is put into that
cell theres more info down below please could anyone help me?

Private Sub Submit_Click()
Dim x As Integer
Dim one As Integer
Dim two As Integer
Dim three As Integer
Dim four As Integer
Dim five As Integer
one = 1
two = 1
three = 1
four = 1
five = 1

x = Range("a1").Value
Range("a1").Value = Range("a2").Value
Range("a2").Value = x + ActiveCell.FormulaR1C1 = "sum(+1)"

'here instead of swopping the values each time a number one to five is
'entered i want 1 to be added so that cell a2 keeps a running total so
'if 9 was entered into cell a1 then 1 would be added to cell a2 then
if
'7 was entered into cell a1 then 1 would be addedd to the one already
in
'cell a2 making the total in that cell 2

End Sub


--
RELWOD85
------------------------------------------------------------------------
RELWOD85's Profile: http://www.excelforum.com/member.php...o&userid=25753
View this thread: http://www.excelforum.com/showthread...hreadid=392323

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default adding a cell to a cell keeping a running total please help

Hi,
To increment A2 by 1 each time:

Range("a2").value=Range("a2").value+1

It's not clear to me what the overall logic is - Is it simply to increment
A2 every time a value is put in A1?.

HTH

"RELWOD85" wrote:


im having a bit of trouble with this coding i want to add a value of one
to a cell to keep a running total no matter what number is put into that
cell theres more info down below please could anyone help me?

Private Sub Submit_Click()
Dim x As Integer
Dim one As Integer
Dim two As Integer
Dim three As Integer
Dim four As Integer
Dim five As Integer
one = 1
two = 1
three = 1
four = 1
five = 1

x = Range("a1").Value
Range("a1").Value = Range("a2").Value
Range("a2").Value = x + ActiveCell.FormulaR1C1 = "sum(+1)"

'here instead of swopping the values each time a number one to five is
'entered i want 1 to be added so that cell a2 keeps a running total so
'if 9 was entered into cell a1 then 1 would be added to cell a2 then
if
'7 was entered into cell a1 then 1 would be addedd to the one already
in
'cell a2 making the total in that cell 2

End Sub


--
RELWOD85
------------------------------------------------------------------------
RELWOD85's Profile: http://www.excelforum.com/member.php...o&userid=25753
View this thread: http://www.excelforum.com/showthread...hreadid=392323


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 entry in one cell to a running total in another cell TommyB Excel Worksheet Functions 1 March 11th 09 11:11 PM
keeping a running total in a single cell shrtdawg73 Excel Worksheet Functions 10 August 23rd 06 12:17 AM
KEEPING THE TOTAL IN C3 WHEN ADDING B3 bouncer8 Excel Discussion (Misc queries) 3 August 19th 06 01:21 AM
KEEPING THE TOTAL IN C3 WHEN ADDING B3 bouncer8 Excel Discussion (Misc queries) 1 August 18th 06 02:41 PM
Keeping formulas on running total and sorts LoriM1 Excel Worksheet Functions 0 April 19th 06 02:58 PM


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

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

About Us

"It's about Microsoft Excel"