+ Reply to Thread
Results 1 to 9 of 9

Why is this VBA code (that I wrote) executing so slow?

  1. #1
    Forum Contributor
    Join Date
    11-30-2012
    Location
    Colorado, US
    MS-Off Ver
    MS Prof. 2010 and 2013 + 365
    Posts
    113

    Why is this VBA code (that I wrote) executing so slow?

    I've created a user form for people to enter data into. All is working well in the workbook, except this form is slowing things down. It takes WAY too long to process the data that is entered (and thus allocated).
    Any suggestions on how to speed this up?

    Please Login or Register  to view this content.
    Last edited by johnw993; 02-08-2015 at 02:20 AM. Reason: didn't clearly show message and code

  2. #2
    Forum Contributor
    Join Date
    11-30-2012
    Location
    Colorado, US
    MS-Off Ver
    MS Prof. 2010 and 2013 + 365
    Posts
    113

    Re: Why is this VBA code (that I wrote) executing so slow?

    Alan,

    My apologies for the mistake. Is the moderation request fulfilled correctly?

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Why is this VBA code (that I wrote) executing so slow?

    Can you submit your workbook? I am a little curious about the interaction of cboDept1_Change() and the UserForm_Initialize processes and how they may be affecting each other. Also, this is beyond reason:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    11-30-2012
    Location
    Colorado, US
    MS-Off Ver
    MS Prof. 2010 and 2013 + 365
    Posts
    113

    Re: Why is this VBA code (that I wrote) executing so slow?

    stnkynts,

    Thanks for your reply. See attached my workbook (in zip file).

    The Workbook is 'Menu driven' and will only show the sheets you've opened. To see all the sheets in the workbook, from the Main Menu click on the Administration button, use Admin as user name and the letter a (small caps) as the password. Then click on "Show All Sheets" button in the upper right.
    The password to un-protect any or all sheets is the letter j (small caps).

    I'm no expert in Excel, and am trying to learn VBA as I go, so I'm sure you'll find some illogical processes in the workbook.

    Thank you for your willingness to take a look.

    John
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Why is this VBA code (that I wrote) executing so slow?

    Please remove from zip file and attach directly.

  6. #6
    Forum Contributor
    Join Date
    11-30-2012
    Location
    Colorado, US
    MS-Off Ver
    MS Prof. 2010 and 2013 + 365
    Posts
    113

    Re: Why is this VBA code (that I wrote) executing so slow?

    Please advise me how to. The file is too large (4.5 MB) to be accepted as an attachment.

  7. #7
    Forum Contributor
    Join Date
    11-30-2012
    Location
    Colorado, US
    MS-Off Ver
    MS Prof. 2010 and 2013 + 365
    Posts
    113

    Re: Why is this VBA code (that I wrote) executing so slow?

    I've been asked to show my workbook, which I'm glad to do, but the forum doesn't allow any workbook larger than 1K to be shared as an attachment. When I send the Workbook in a zip file, I'm being asked to please unzip and send it as a workbook. I'm confused. Please advise what I should do.
    This site has been a great learning experience and I really, really would like some feedback on the issues I'm trying to solve in my workbook.

    Thank you,

    John

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Why is this VBA code (that I wrote) executing so slow?

    Hello johnw993,

    Leave your workbook zipped. You were correct in following the forum's rule for posting. If a member is unable to open the workbook because the file is corrupted then you should repost. However, if a member does do not possess the needed software to open the file, that is not your problem.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  9. #9
    Forum Contributor
    Join Date
    11-30-2012
    Location
    Colorado, US
    MS-Off Ver
    MS Prof. 2010 and 2013 + 365
    Posts
    113

    Re: Why is this VBA code (that I wrote) executing so slow?

    Thank you for your reply Leith. I was starting to wonder what I was doing wrong.
    I guess if no-one else replies to my post/question, my question must not be enticing enough.
    It's a challenge to find a VBA expert who can look at my code and explain to me why my code is slowing things down (because I suspect I wrote it very poorly).
    I'll post my message/question again.

    Regards,

    John

+ 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. The runtime for my code I wrote takes too long, is there a way tocan you condense?
    By dnice0123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2014, 03:33 AM
  2. Replies: 10
    Last Post: 11-13-2013, 09:01 PM
  3. VBA code that I wrote seems to be looping without a Do...Loop statement. Why?
    By carpe.cervisiam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-07-2012, 12:08 AM
  4. QUERY & HELP: so slow executing VBA code... :S
    By KevinGPO in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-13-2006, 11:50 AM
  5. [SOLVED] QUERY & HELP: so slow executing VBA code... :S
    By KevinGPO in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-13-2006, 11:50 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