+ Reply to Thread
Results 1 to 13 of 13

Loading data from user form to cell is very slow

  1. #1
    Registered User
    Join Date
    03-11-2018
    Location
    Michigan,USA
    MS-Off Ver
    MS Office 2010
    Posts
    34

    Loading data from user form to cell is very slow

    Hi Team

    I have this code and it makes my worksheet load slowly. Data from user form is being populated into a row very slowly. I have the code added to this post.

    File has 10 tabs with many Vlookup from one workbook to other. Kindly help me to make the loading process faster

    code as follows
    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    03-11-2018
    Location
    Michigan,USA
    MS-Off Ver
    MS Office 2010
    Posts
    34

    Re: Loading data from user form to cell is very slow

    can anyone help me on this????????

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,427

    Re: Loading data from user form to cell is very slow

    Please remember that those who help here do so voluntarily and of their own goodwill. They live in many different time zones and many will be out at work right now if they are not asleep on the other side of the globe. Members will help when they are ready and able to do so, and not 'on demand'. Please do not try to put pressure of time on anyone here: if you get the help you need today, that's fine, but you really should not count on it. Thanks for your understanding and patience.

    From the forum rules (link in the main menu above):
    • If your question has not been answered within a day, consider adding another post with any additional information you believe is relevant. If you think your post is good as is, just reply to your own thread with the words "Bump no response", which will bring it to the top of the forum.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,156

    Re: Loading data from user form to cell is very slow

    Quote Originally Posted by AliGW View Post
    ... They live in many different time zones ...
    blackat.gif

    Quote Originally Posted by vinodhmmraj View Post
    1. ... this code ... makes my worksheet load slowly. Data ... is being populated into a row very slowly...
    2. ... File has 10 tabs with many Vlookup from one workbook to other...
    It's not a macro, the main culprit are the functions on the sheet, take a look here for example, a similar topic:
    https://www.excelforum.com/excel-for...umproduct.html

    When it comes to macros, then:
    1. Don't use the "MsgBox" function in a user-defined function, rather send the result of the UDF to "MsgBox".

    2. "Application.ScreenUpdating" is unnecessary in the function, because the function is passive, it does not perform active tasks.

    3. Don't use words reserved in vba as variables, e.g. 'Name' in 'FindColumnByName' function.

    4. What in fact does the 'RowBOMLevel' function do (btw, missing 'c' variable) ?
    a. The 'For ... Next' loop in this UDF will only be executed once for the 'If' statement, and then no longer, because of 'LevelVal = "" ' before the loop.
    b. 'LevelVal = Cells(r, c).Text' - Is the formatted value really required ? After a while you're converting it to 'Integer': 'Level = CInt(LevelVal)', so all you need is '.Value'.

    5. 'Range("AA1:AA5000").Column' in 'CommandButton1_Click' is always 27 and 'Range("AB1:AB5000").Column' is always 28.

    6. 'vbNullString' in 'Worksheet_Change':
    The meaning of 'vbNullString' => "String having value 0, not the same as a zero-length string (""); used for calling external procedures." - from contextual help 'Ms'.
    Are you sure it's not about ' "" ' ?
    If "InputBox("Reason for Changes:", "Add Comments...")" is "empty", then 'UserComments' = "".

    7. The 'FindColumnByName' function can be written with a simpler construction without loop, e.g.:
    Please Login or Register  to view this content.
    It should be a bit faster.

  5. #5
    Registered User
    Join Date
    03-11-2018
    Location
    Michigan,USA
    MS-Off Ver
    MS Office 2010
    Posts
    34

    Re: Loading data from user form to cell is very slow

    hi porucha vevrku
    I will use your valuable suggestion to update and will let u know how it works,

    Thanks

  6. #6
    Registered User
    Join Date
    03-11-2018
    Location
    Michigan,USA
    MS-Off Ver
    MS Office 2010
    Posts
    34

    Re: Loading data from user form to cell is very slow

    Hi Porucha vevrku
    Need your help on this
    1/ Don't use the "MsgBox" function in a user-defined function, rather send the result of the UDF to "MsgBox". (can you use my code and let me know how to do it.)

    Please Login or Register  to view this content.
    5. 'Range("AA1:AA5000").Column' in 'CommandButton1_Click' is always 27 and 'Range("AB1:AB5000").Column' is always 28. - can you explain me this what i need to do

  7. #7
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,156

    Re: Loading data from user form to cell is very slow

    Ad 5. For example:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-11-2018
    Location
    Michigan,USA
    MS-Off Ver
    MS Office 2010
    Posts
    34

    Re: Loading data from user form to cell is very slow

    Hi Porucha vevrku
    i replaced my code with your and it seems it take more time than before. Inserting blank row takes more time than before and after i feed in the data in user form it takes approx 1 min 20 sec to insert into its respective cells.

    Can you kindly help me on this please.

    Thanks
    Vinodh

  9. #9
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,156

    Re: Loading data from user form to cell is very slow

    And in this way (change of 'UserForm' generation places, at the end of the macro) ?
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    03-11-2018
    Location
    Michigan,USA
    MS-Off Ver
    MS Office 2010
    Posts
    34

    Re: Loading data from user form to cell is very slow

    Hi Porucha vevrku
    i replaced my code with your and it seems it reduced 15 sec time than before. but still in the 1min range. any more guidance possible

    Can you kindly help me on this please.

    Thanks
    Vinodh

  11. #11
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,156

    Re: Loading data from user form to cell is very slow

    1. How do you measure this time ?
    2. How do you fill 'UserForm' ?
    3. Have you already solved the case of the "huge amount" of the 'VLookup' function in your workbook ?

  12. #12
    Registered User
    Join Date
    03-11-2018
    Location
    Michigan,USA
    MS-Off Ver
    MS Office 2010
    Posts
    34

    Re: Loading data from user form to cell is very slow

    Hi Porucha Vevrku

    1- I stop watch the time i click the submit button
    2- User form (screenshot of user form attached) is manually filled in by user and click enter data button
    3- Huge data in other worksheet using vlookup still not resolved. need some help there as well. if you could help me that would be great

    Thanks
    Vinodh
    Attached Images Attached Images

  13. #13
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,156

    Re: Loading data from user form to cell is very slow

    Get acquainted with this topic (the main thesis: "Wherever possible, replace the functions with their results"; functions can always be reproduced, manually or with a macro):
    https://www.excelforum.com/excel-for...umproduct.html

    and/or look for others, similar on forum, e.g:
    https://www.excelforum.com/excel-pro...readsheet.html
    https://www.excelforum.com/excel-for...culations.html

    others, e.g.:
    https://msdn.microsoft.com/en-us/vba...on-performance

+ 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. User form very slow to transfer data to worksheet
    By sbana in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-08-2022, 01:35 AM
  2. Process time to load data from User form to cell is very SLOW
    By vinodhmmraj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-13-2018, 03:57 PM
  3. Loading images from sheet into user form without opening sheets
    By Boechat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-19-2016, 05:35 PM
  4. [SOLVED] Problem with user form not loading
    By mezza89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-24-2014, 06:30 PM
  5. [SOLVED] Problem with user form not loading?
    By mezza89 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-25-2014, 08:17 AM
  6. Slow data loading
    By nightduke in forum Excel General
    Replies: 0
    Last Post: 11-22-2006, 11:02 AM
  7. Loading a calendar (user form) from another project (personal.xls)
    By Ollie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2005, 05:05 PM

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