Results 1 to 9 of 9
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Location
    Edmonton, Alberta
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro (Excel 2003)

    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.
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro (Excel 2003)

    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.

  3. #3
    Star Lounger
    Join Date
    Sep 2002
    Location
    Edmonton, Alberta
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro (Excel 2003)

    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

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro (Excel 2003)

    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

  5. #5
    Star Lounger
    Join Date
    Sep 2002
    Location
    Edmonton, Alberta
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro (Excel 2003)

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

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro (Excel 2003)

    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.

  7. #7
    Star Lounger
    Join Date
    Sep 2002
    Location
    Edmonton, Alberta
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro (Excel 2003)

    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?

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro (Excel 2003)

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

    See the attached version.
    Attached Files Attached Files

  9. #9
    Star Lounger
    Join Date
    Sep 2002
    Location
    Edmonton, Alberta
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro (Excel 2003)

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

Posting Permissions

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