+ Reply to Thread
Results 1 to 2 of 2

Macro runs slow automating it within a function, but works fine running it manually

  1. #1
    Registered User
    Join Date
    03-22-2011
    Location
    ontario, canada
    MS-Off Ver
    Excel 2003
    Posts
    27

    Macro runs slow automating it within a function, but works fine running it manually

    I am manipulating some data and to speed things up i decided to create a function to copy the relevant rows to another spreadsheet.

    i was having trouble getting the function to work but could not find any reason for it. I changed it into a macro instead and it works fine when i run it manually from the drop down menu.. here is my code

    Please Login or Register  to view this content.
    when i run the macro it is quick, and speeds up the calculations of my vba functions since it is only sorting through the relevant data. Problem is i want the macro to run automatically any time a user alters a cell because it may have to pull different data depending on what the user is asking for.

    i figured i could do this by
    Please Login or Register  to view this content.
    but when i do it this way everything is slow as snails.

    not sure what the issue is with copying rows, but it seems strange that it would not work as a function, and then also does not work right when i call it as a macro through a function. but works fine when i manually run it as a macro. has anyone experienced this?
    Last edited by asinger; 07-14-2011 at 03:10 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro runs slow automating it within a function, but works fine running it manual

    I don't see why you need the Function. The actual code could run better if you didn't use Select & a Loop. Post a sample workbook
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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