Needed Code for Doing Subtotal in Next Colounm

  • Hi

    Can anyone please help as i dont no much about VBA Coding.... i have spreadsheet in which i want to subtotal in next column which i have highlighted in yellow colour .... i have attached my spreadsheet ...Pls help with code

  • Hello and Welcome to the Forum :)


    Thanks for your file


    Do you mean you would like a macro to create all the results in the cells you have highlighted in yellow ...?

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • Yes Carim .... i want a macro to creat all the result in cells i have highlighted ..... but it should be dynamic .....Depending on Particular and Amt Column ... I should get subtotal ..... and Where ever is amt in subtotal column ...in front of that want in Bank Charges Column.... And Cheque Amt Should be Sub total amt minus 5....... Pls Help with the VBA Code that.....

  • Hello,


    Thanks for your explanations


    Attached is your test file


    Hope this will help

    Files

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • The simplest way is always to use inbuilt features instead of VBA. Use the Subtotal feature from the Data Tab.

  • Hi Carim.....

    But when my rows increase with data ...... itshow Type Mismatch Error ....I think Bocz you have lock the row till 19 row

    every time my data might be less or might be more..... So i require it to be dynamic... Please help

  • Re,


    Sorry for this mistake ?(


    Attached is your Version 2 with correction ...


    Hope this will help

    Files

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • Hi Carim

    Your Version 2 file working fine.... in this file can u put the sum formula at the bottom of

    Amt , Sub Total ,Bank Chrgs , Cheque Amt Coloumn .... the formula should come in excel file through the code it should do the total from first row of amt to lastrow of amt (it should be dynamic ..... it data is less or more accordingly)


    Similary formula in Cheque Amt Coloumn (Sub Total - Bank Chrgs = Cheque Amt ) Only Where the amt is pasted in Sub Total and Bank Charges Coloumn ) the formula should come in Excel file through the code ....


    When put the cursor on cell of total the formula should seen in formula bar........


    Pls Help me with Code

  • Hi Carim

    Your Version 2 file working fine.... in this file can u put the sum formula at the bottom of

    Amt , Sub Total ,Bank Chrgs , Cheque Amt Coloumn .... the formula should come in excel file through the code it should do the total from first row of amt to lastrow of amt (it should be dynamic ..... it data is less or more accordingly)


    Similary formula in Cheque Amt Coloumn (Sub Total - Bank Chrgs = Cheque Amt ) Only Where the amt is pasted in Sub Total and Bank Charges Coloumn ) the formula should come in Excel file through the code ....



    When put the cursor on cell of total the formula should seen in formula bar........


    Pls Help me with Code