Home |
Search |
Today's Posts |
#1
|
|||
|
|||
macro for invoice totals
I have this macro that inserts lines and copies a invoice header.
Now I want to total the invoice. In the first row after a value in B in E the word totals must be inserted, H, I and K must be summed the amount of lines differ on each invoice but there is a heading from where it must be summed. CTNS(H), QTY(I), Total(K) Thanks a lot. Public Sub Deilv2() Dim LastRow As Long Dim row_index As Long Dim rng As Range Set rng = Range("B2:K25") Application.ScreenUpdating = False LastRow = ActiveSheet.Cells(Rows.Count, "b").End(xlUp).Row For row_index = LastRow - 1 To 26 Step -1 If Cells(row_index, "B").Value < _ Cells(row_index + 1, "B").Value Then Cells(row_index + 1, "B").Resize(26).EntireRow. _ insert Shift:=xlDown rng.Copy Destination:=Cells(row_index + 1, "B").Offset(2) End If Next Application.ScreenUpdating = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Help with macro looping and color query function | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) | |||
running totals in a macro for each month | Excel Worksheet Functions |