Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Here is a macro to update the list with the amount on the invoice. The list
has a dynamic range name for the contract numbers (in ascending order) and Contract details that includes the the Contract ID, the contract amount, the amount previously billed, and the customer ID. Each time the macro is run the Invoice total is added to the contract details. I've included a msgbox so that you can check. Public Sub UpdateContractsList() Dim rngOrders As Range Dim rngContractID As Range 'Dynamic range name Dim rngInvoiceTotal As Range Dim rngAmoutLeft As Range Dim rngAmountLeft As Range Dim rngOrderDetails As Range Dim x Dim lRow As Long Set rngOrderDetails = Range("Contracts") Set rngContractID = Sheets("Sheet1").Range("E1") Set rngAmoutLeft = Sheets("Sheet1").Range("E1") Set rngInvoiceTotal = Sheets("Sheet1").Range("E6") Set rngOrders = Range("ContractNumbers") 'how much do we owe? x = WorksheetFunction.VLookup(rngContractID.Value, rngOrderDetails, 3, 0) MsgBox x lRow = WorksheetFunction.Match(rngContractID.Value, rngOrders, 0) + 1 'add Invoice total to amount paid With Sheets("Sheet2") .Cells(lRow, 3) = .Cells(lRow, 3).Value + rngInvoiceTotal.Value End With 'now how much is paid? x = WorksheetFunction.VLookup(rngContractID.Value, rngOrderDetails, 3, 0) MsgBox x End Sub If you would me to look at it further yo can send me your file, together with details of exactly you want. peter_atherton at hotmail.com change the at in the address as normal. Peter "tb" wrote: I am looking for a template for Invoices to calculate for contracts. I looked through templates and cannot find anything to work, any other suggestions? I have my basic Invoice, which works good, but when it comes to contract Jobs I am trying to find a template to enter in 'Contract Amount' and % we have completed to date to get total due. When I go to Invoice again I want to try and have it where it comes up 'Less Previous billed' to calculate my new Invoice owing. Thank you again......I really appreciate all the help!!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Date percent complete as of today | Excel Discussion (Misc queries) | |||
Percent of a Spreadsheet Complete | Excel Worksheet Functions | |||
Formula percent complete excluding given text string | Excel Discussion (Misc queries) | |||
Percent Complete? | Excel Discussion (Misc queries) | |||
Percent Complete? | Excel Discussion (Misc queries) |