Page 1 of 1

vba sum

Posted: Sun Sep 18, 2022 10:34 pm
by sna
Hello code experts
If you press the button in the conditions sheet, a new sheet is created by the name of portal.
In this workbook, the 2B sheet containing the same Invoice Number have different amount values in column J K L M and N. The amount values of J K L and M are combined in one row and displayed in Portal sheet. I want to combine the values of column N also and display in the Portal sheet. For that, I need your expertise and help to to edit the code to get the combined value of N in the portal sheet.

Tks

Re: vba sum

Posted: Mon Sep 19, 2022 9:21 pm
by snasui
:D Change this statement

Code: Select all

dic(id) = s(0) & "|" & s(1) & "|" & s(2) & "|" & s(3) & "|" & s(4) & "|" & _
        s(5) & "+" & cell.Offset(0, 8) & "|" & s(6) + cell.Offset(0, 9) & "|" & _
        s(7) + cell.Offset(0, 10) & "|" & s(8) + cell.Offset(0, 11) & "|" & _
        s(9) + cell.Offset(0, 12) & "|" & s(10) & "|" & s(11) & "|" & _
        s(12) & "|" & s(13) & "|" & s(14) & "|"
to

Code: Select all

dic(id) = s(0) & "|" & s(1) & "|" & s(2) & "|" & s(3) & "|" & s(4) & "|" & _
        s(5) & "+" & cell.Offset(0, 8) & "|" & s(6) + cell.Offset(0, 9) & "|" & _
        s(7) + cell.Offset(0, 10) & "|" & s(8) + cell.Offset(0, 11) & "|" & _
        s(9) + cell.Offset(0, 12) & "|" & s(10) + cell.Offset(0, 13) & "|" & s(11) & "|" & _
        s(12) & "|" & s(13) & "|" & s(14) & "|"

Re: vba sum

Posted: Tue Sep 20, 2022 6:31 am
by sna
thank you ☺️