• Macro (Excel 2003)

    Author
    Topic
    #451637

    I was wondering if someone could help me with a macro in Excel – it isn’t counting the Disciplines like it is supposed to. Thank you in advance.

    Viewing 0 reply threads
    Author
    Replies
    • #1112398

      You’re looping through the non-blank cells in column F (column number 6), starting at row 23. But there are no such cells – column F is blank from row 20 down. Perhaps you should use column H (column number 8) instead of F. But then it’s not clear what you want with the rest of your code.

      • #1112409

        Hi Hans – again I get asked to fix something – just because I know a little bit about Access & Excel. Thanks for your help. The spreadsheet is supposed to Count the Disciplines when you click the Current Total button – then put the result in F3 to F10. Someone else created this Macro and I tried to fix it.
        Thanks Again

        • #1112410

          Apparently, two columns have been inserted but the macro hasn’t been updated accordingly.

          Use Edit | Replace to replace:
          – all instances of , 11 with , 13
          – all instances of , 10 with , 12
          – all instances of , 9 with , 11
          – all instances of , 8 with , 10
          – all instances of , 6 with , 8

          • #1112422

            Hans it still didn’t work – What are the green parts of the VB Macro?
            Thanks

            • #1112423

              The green parts are lines that have been made into comments by inserting an apostrophe in front of them. Comments are not executed.

              In what sense doesn’t it work? Please try to be specific.

            • #1112425

              If I do a filter on Elec in col H (Discipline) I get 22 but on the Totals col. in col F I get 16. Can I send this to you again?

            • #1112426

              I’d use formulas instead of a macro – it’s very difficult to maintain the macro.

              See the attached version.

            • #1112428

              Hans as usual you are wonderful. Thank you so much it works great.

    Viewing 0 reply threads
    Reply To: Macro (Excel 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: