PDA

View Full Version : Problems in a simple billing tool!



swagat
10-10-2011, 11:10 PM
My workbook has two sheets by the name bill and customers.
The bill worksheet generates a bill for a customer name in H2(present in the customer worksheet in column A ) with the help of a drop down list.
Now I added a command button to my bill worksheet which when clicked should add the total amount present in cell F2 ,to my customers worksheet for the particular customer's previous credit amount in column B.
For example if bill is generated for Harry then pressing the command button adds the bill amount to harry's previous credit in my customer sheet.

Bob Phillips
10-11-2011, 12:04 AM
And? So you did that, why are you telling us?

swagat
10-11-2011, 12:43 AM
My Mistake I did not state the problem I am facing.I am unable to do the last part of it,that is once the total has been generated what should be the vba code for the command button so that the total is credited to the particular customer list!

Bob Phillips
10-11-2011, 02:51 AM
So what is the code that is not working?

swagat
10-11-2011, 05:37 AM
My first problem is that how do i update the new value of the cell as the old value of cell +value in some other cell.

Bob Phillips
10-11-2011, 03:22 PM
Show us your code!

CatDaddy
10-11-2011, 05:11 PM
mySum = sum(Cells(r,c).value, Cells(r,c).value...)
or
mySum = mySum + Cells(r,c).value
or
mySum = mySum + Range(someRange).Value

depends on how you are working the problem :)