Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Accumulated Amount Problem - Excel VBA

How to write VBA for the accumulated amount column which could
automatically be entered when the charge column has been inputted.

Description Charge Accumulated Amount

Toys 200 200
Bags 350 550
Books 400 950


Thanks


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Accumulated Amount Problem - Excel VBA

Hi

one solution without VBA just Excel formulas
In the first cell for your accumulated amount (assumption: cell C2)
enter the following
=IF(B2<"",B2,"")
in cell C3 enter the following:
=IF(B3<"",C2+B3,"")
copy this formula down

HTH
Frank


How to write VBA for the accumulated amount column which could
automatically be entered when the charge column has been inputted.

Description Charge Accumulated Amount

Toys 200 200
Bags 350 550
Books 400 950


Thanks


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Accumulated Amount Problem - Excel VBA

Henry,

This goes in the worksheet code module

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
On Error GoTo ws_exit
If Target.Column = 2 Then
Target.Offset(0, 1).FormulaR1C1 = "=sum(R1C[-1]:R" & Target.Row &
"C[-1])"
End If

ws_exit:
Application.EnableEvents = True
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"henrycheung " wrote in message
...
How to write VBA for the accumulated amount column which could
automatically be entered when the charge column has been inputted.

Description Charge Accumulated Amount

Toys 200 200
Bags 350 550
Books 400 950


Thanks


---
Message posted from http://www.ExcelForum.com/



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
Accumulated percentage calculation Terence C Excel Worksheet Functions 2 April 21st 09 01:12 AM
how to create an accumulated value DaveM Excel Discussion (Misc queries) 1 November 19th 07 04:21 AM
Accumulated Time Format Ray[_3_] Excel Discussion (Misc queries) 2 August 4th 07 12:07 PM
Accumulated wealth formula ? toyota58 Excel Worksheet Functions 8 February 24th 07 01:54 AM
Problem with working out the amount of quarters between two dates Nigel Brown[_2_] Excel Programming 2 August 8th 03 02:06 PM


All times are GMT +1. The time now is 03:01 AM.

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"