Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Running total macro issue


Hello everyone, and thanks in advance for the help.

I sell a number of items and am using an excel sheet to keep track of
them. I currently have it set so that a number of buttons I click
increment a column of numbers that show how many I need to make of that
item (to replenish stock). I then have a 3rd column keeping track of how
many I have sold of that item. Here is an example:

Item A | 5 | 103

In this example, I have recently sold (and need to make) 5 of item A.
In the past I've sold 103 total.

Currently, I'm doing it all manually. I need a macro that will add the
numbers in column B into column C and then delete column B.

So in the example above, after running the macro, it would look like:

Item A | 0 | 108

I have a large number of rows I need this done on, and more rows may be
added in the future.

If you need any more information, please let me know.


--
Onyx
------------------------------------------------------------------------
Onyx's Profile: http://www.thecodecage.com/forumz/member.php?userid=290
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=93859

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Running total macro issue

Hi

Add another button to "Update Totals", and call this macro (change the
Sub name as required. In my example qunatities recently sold is in
B2:B10.

Private Sub CommandButton1_Click()
Dim TargetRange As Range
Dim Cell As Range
Set TargetRange = Range("B2:B10")
For Each Cell In TargetRange
Cell.Offset(0, 1) = Cell.Offset(0, 1) + Cell.Value
Cell.Value = 0
Next
End Sub

Hopes this helps.

---
Per

On 6 Maj, 19:19, Onyx wrote:
Hello everyone, and thanks in advance for the help.

I sell a number of items and am using an excel sheet to keep track of
them. I currently have it set so that a number of buttons I click
increment a column of numbers that show how many I need to make of that
item (to replenish stock). I then have a 3rd column keeping track of how
many I have sold of that item. Here is an example:

Item A | 5 | 103

In this example, I have recently sold (and need to make) 5 of item A.
In the past I've sold 103 total.

Currently, I'm doing it all manually. I need a macro that will add the
numbers in column B into column C and then delete column B.

So in the example above, after running the macro, it would look like:

Item A | 0 | 108

I have a large number of rows I need this done on, and more rows may be
added in the future.

If you need any more information, please let me know.

--
Onyx
------------------------------------------------------------------------
Onyx's Profile:http://www.thecodecage.com/forumz/member.php?userid=290
View this thread:http://www.thecodecage.com/forumz/sh...ad.php?t=93859


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
Duplicate Running Total Grand Total In Pivot Table Mathew P Bennett[_2_] Excel Discussion (Misc queries) 1 August 17th 08 03:13 AM
running total and average of that total after 3 events belvy123 Excel Discussion (Misc queries) 0 March 28th 07 02:57 AM
running total and average of that total after 3 events Toppers Excel Discussion (Misc queries) 1 March 28th 07 02:19 AM
% of Running Total to Grand Total in Pivot Table David Excel Programming 0 August 17th 05 08:24 PM
Running total using macro Rusty[_5_] Excel Programming 1 March 4th 04 11:30 AM


All times are GMT +1. The time now is 11:59 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"