Consulting

Results 1 to 4 of 4

Thread: VBA Macro FUNCTION To Sum Up Values of multiplier of muti-Columns

  1. #1

    VBA Macro FUNCTION To Sum Up Values of multiplier of muti-Columns

    Dear everyone.

    I have to create a new function that sum of multiplier of muti-columns like below
    A B C D E F G H
    Qty' Price Qty' Price Qty' Price Total
    Code1: 20 5 15 6 21 5.2 =Sum(B3*C3+D3*E3+F3*G3) -> function for this fomula
    Code1: 20 5 15 6 21 5.2 =Sum(B4*C4+D4*E4+F4*G4)
    Code1: 20 5 15 6 21 5.2 =Sum(B5*C5+D5*E5+F5*G5)
    Code1: 20 5 15 6 21 5.2 =Sum(B6*C6+D6*E6+F6*G6)
    Who can help me solve it?
    Many thanks to you.

  2. #2
    Solved.

  3. #3
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    welcome to VBAX tungtran.ftu

    it's a good practice to share the solution for other users who may need it in the future.

    another good habit is to mark the thread as solved from thread tools (topright corner of the page, above the first mesage).
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  4. #4
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    anyway...

    =SUM(B3*C3,D3*E3,F3*G3)

    or
    =B3*C3+D3*E3+F3*G3

    or
    =SUMPRODUCT(CHOOSE({1;2;3},B3,D3,F3);CHOOSE({1;2;3},C3,E3,G3))
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •