+ Reply to Thread
Results 1 to 7 of 7

Excel running slow due to macros

  1. #1
    Registered User
    Join Date
    01-31-2022
    Location
    Ontario, Canada
    MS-Off Ver
    O365
    Posts
    4

    Excel running slow due to macros

    Hello,

    I'm new to VBA and I need some help with speed being slow when inputing data into my file (sorry for my data being in French). When I input data in the Fields entitled "École", "Année scolaire", i can't do anything for about 4 seconds. When I input data into the field "Nombre d'élèves", and I click on the big yellow button to get to another sheet (see 2nd image) then the number of lines showing should match the number inputed on the first sheet by using a code (see below - code) (I have two other similar sheet using the same code that is password locked which you can access by clicking on the left green button on the 1st image, but those sheets are running a little faster) and there are also some formulas in the sheet itself (see below - formulas)

    Image 1
    Screen Shot 2022-01-31 at 11.21.57 AM.png

    Image 2
    Screen Shot 2022-01-31 at 11.25.52 AM.png

    Code
    Please Login or Register  to view this content.
    Formula
    =IFERROR(IF(Accueil!E13="","",1),"")
    =IFERROR(IF(A11+1>Accueil!E$13,"",Ecole!A11+1),"")

    where "Ecole" is the active sheet (image 2) and "Accueil!E$13" is the cell I inputed the number 2 in image 1

    I then manually input data in the other columns in image 2 and here is where it gets really slow, about 15 seconds before I can click in another cell.

    I must say that the data inputed into image 2 is beeing copied to 3 other sheets.

    Any help would be appreciated

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Excel running slow due to macros

    Hi and welcome to the forum,

    Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.

    Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.

    Also tell us what you want to achieve, NOT what you are currently doing to achieve your goal. We can often find simpler, quicker and more elegant solutions. It may be that you don't need a loop that iterates 100 times. Loops should only be used as a last resort since they can be extremely slow.

    To upload a file click the Go Advanced button at the foot of your post, look underneath the post area for the Manage Attachments section and take it from there.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    01-31-2022
    Location
    Ontario, Canada
    MS-Off Ver
    O365
    Posts
    4

    Re: Excel running slow due to macros

    Hi Richard,

    Thanks for your reply. Like I said i'm fairly new to this. I tried to upload a part of my file but it is too big. Every code is doing what it is suppose to do. Except it runs really slow. I can see the word "Calculate" in the botton left of my screen every time I input data into a cell. My question is, how do I make it faster. I can't ask people to share me their data if they have to wait 15 seconds every time they input data into one cell, they have 18 cells per row to input data. I could send you my file by email if that would help. I really appreciate you taking the time to help me with this.

    Janie

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,246

    Re: Excel running slow due to macros

    Without an example file, it's hard to guess where the problem lies. We can only guess that the Calculate event arouses too often.
    For now, try changing the procedure like this:
    Please Login or Register  to view this content.
    Artik

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Excel running slow due to macros

    We don't need a workbook with zillions of rows, a representative cut down (anonymised if necessary) copy will do.

    Why do you want to process the loop for every calculation? Why not for instance when one of the buttons is pressed?
    It may not be necessary to use a loop at all. There may be a simpler, efficient and elegant solution.

    Tell us what you want to achieve, NOT how you are currently trying to do it.

  6. #6
    Registered User
    Join Date
    01-31-2022
    Location
    Ontario, Canada
    MS-Off Ver
    O365
    Posts
    4

    Re: Excel running slow due to macros

    I don't really need to run a loop. I would prefer applying changes when i press a button. But what would the code look like ? And would I be placing the code in a module instead of directly on the sheet?

  7. #7
    Registered User
    Join Date
    01-31-2022
    Location
    Ontario, Canada
    MS-Off Ver
    O365
    Posts
    4

    Re: Excel running slow due to macros

    Sorry If I didn't follow the rules......I was unaware. So now that I know I will abide by them. I asked the same questions in two other forums as I was in a crunch to present my work to my employer. I did find a solution in another forum. I'm trying to copy the link to this thread but it is not letting me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Slow running of Excel macros embedded in an ActiveX
    By Philip Kinchington in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2019, 02:54 AM
  2. Macros running slow in Excel 2013
    By lgolf in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-09-2014, 12:56 PM
  3. [SOLVED] Macros running slow on Excel 2003 but not on Excel 2002
    By James in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-23-2006, 09:37 PM
  4. Macros running very slow in Excel 2003
    By ebeltran in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-16-2005, 02:46 PM
  5. [SOLVED] Macros running slow in Excel 2003
    By ebeltran in forum Excel General
    Replies: 0
    Last Post: 03-08-2005, 06:06 PM
  6. Slow running of Excel macros embedded in an ActiveX
    By Philip Kinchington in forum Excel General
    Replies: 0
    Last Post: 03-08-2005, 05:06 PM
  7. [SOLVED] excel macros running slow with XP
    By Helen@bgs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-09-2005, 10:06 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1