+ Reply to Thread
Results 1 to 6 of 6

USE ALL CODES in 1 code

  1. #1
    Forum Contributor
    Join Date
    08-06-2014
    Location
    iran
    MS-Off Ver
    2016
    Posts
    110

    USE ALL CODES in 1 code

    hi can any body help me
    i run allsheets code as below and it takes long time for example i had 800 sheets and it takes time about 4 hours of me
    i think it can be shorter and better
    please help me to gather all in one code
    Please Login or Register  to view this content.
    Than k you so much

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: USE ALL CODES in 1 code

    I'd take such measures to make it quicker
    in AllSheets
    Please Login or Register  to view this content.
    Swithing off automatic recalculation and calling
    Please Login or Register  to view this content.
    only after
    Please Login or Register  to view this content.
    is filled with formula, then after
    Please Login or Register  to view this content.
    is filled with formula
    If you don't need formulas in M and R columns I'd convert (after recalculation) these columns formulas -> to values, like:

    Please Login or Register  to view this content.
    I'd not use
    Please Login or Register  to view this content.
    after each graph is prepared (it's 800 large workbook saving actions!)

    and as for errors searching and replacing - if you could allow all errors (not only #DIV/0!) to be replaced with "" then

    Please Login or Register  to view this content.
    PS. Just putting all actions into one sub (which is perfectly possible) will save you no noticeable time amount. But the proposed ammendments could save a lot. Of courrse 800 sheets (with 800 graphs!) is still very large file and some time will be needed to process it.
    Last edited by Kaper; 05-21-2020 at 12:59 PM.
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    08-06-2014
    Location
    iran
    MS-Off Ver
    2016
    Posts
    110

    Re: USE ALL CODES in 1 code

    Hi Mr Kaper
    please use this workbook for running your code and compare its result with my previous code (i should say that it is not my code some one else wrote it and i appreciate him or her same as you)
    thank you
    Attached Files Attached Files

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: USE ALL CODES in 1 code

    800 sheets - 4 Hours...
    As per Kaper suggestions...Down to 8 seconds...
    I don't see the need for Error delete code...Perhaps formula need to be adjusted to ensure no errors in formula...
    can only see once a sample file is uploaded containing such errors...
    Please Login or Register  to view this content.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  5. #5
    Forum Contributor
    Join Date
    08-06-2014
    Location
    iran
    MS-Off Ver
    2016
    Posts
    110

    Re: USE ALL CODES in 1 code

    Hi Mr Sintek
    your code could be acceptable if the DivError not exist so please check your previous code and put this part (ReplaceDivError) in it .
    i attached an example for this error.
    thank you
    Attached Files Attached Files

  6. #6
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: USE ALL CODES in 1 code

    if you want to clear errors just change formula...
    Please Login or Register  to view this content.

+ 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. [SOLVED] Need advice on VBA code in sheet / 2 different codes
    By Chu3 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-25-2019, 09:57 AM
  2. [SOLVED] Merging Two VBA Codes to one Code
    By mvinay in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-22-2019, 01:30 AM
  3. Testing single code, work fine. Put multiple codes in one sheet, one code doesn't work.
    By MayDay1988 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-30-2017, 06:14 PM
  4. Replies: 7
    Last Post: 08-13-2015, 10:58 AM
  5. How to connect these two codes into one code.
    By Zahhhaaaa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-21-2011, 07:22 AM
  6. Code 3 of 9 bar codes and Excel
    By iIgnite in forum Excel General
    Replies: 2
    Last Post: 06-14-2011, 02:37 AM
  7. Merging Two Codes Into one code
    By LoveCandle in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-27-2005, 12:13 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