Forum Discussion

bruce carskadon's avatar
bruce carskadon
Copper Contributor
Jul 21, 2018

slow after running macro

I run a macro in excel using VB.  It runs extremely slow.  Once the program ends, the workbook is very slow to respond in normal worksheet movements.  if I close the program and reopen, it responds normally.

12 Replies

  • Haytham Amairah's avatar
    Haytham Amairah
    Silver Contributor

    Hi Bruce,

     

    We need to see this macro to figure out what the problem is.

    Please copy the macro code here in a reply.

    It would be better if you can attach the workbook itself.

     

    Regards

    • bruce carskadon's avatar
      bruce carskadon
      Copper Contributor

      Hi Haytham,

       

      Thanks for taking the time to look at it. 

       

      I have attached a copy of the workbook (I have put random names in the name column, but that does not affect the macro).  I am not a sophisticated programmer and don’t know all the shortcuts in coding, but the macro does what I want it to do, it just takes too much time, and once it exits, the workbook is slow to navigate until I close it and reopen it.

       

      The macro does two basic procedures:

       

      1. it compares the raw data from golfers scores, computes the senior handicaps and compares it to the course handicap

       

      1. it takes the individual raw data, sorts by name, and prepares a printable version for each player. 

       

      If you see a fix, just send me a copy to the revised macro with any comments you want to make.

       

       

      Thanks,

      Bruce

      • Haytham Amairah's avatar
        Haytham Amairah
        Silver Contributor

        Hi Bruce,

         

        Sorry on the late reply!

        The macro performs a very long operation, and includes several For Loops statements, this is why it takes too much time!

         

        Another reason, there are too many Conditional Formatting rules in the worksheet!

         

        However, I've updated the macro to speed up the operation, please test it in the attached file.

         

        Also, please review Conditional Formatting rules in the worksheet and see if you really need them all.

         

        Regards

Resources