+ Reply to Thread
Results 1 to 6 of 6

The Proper way to get rid of "Long Procedure" error

  1. #1
    Registered User
    Join Date
    10-22-2018
    Location
    Turkey
    MS-Off Ver
    Office2010
    Posts
    84

    Question The Proper way to get rid of "Long Procedure" error

    Dear all. My excel file with macro is attached. My problem is the current macro gives "Long Procedure" error if I extends the codes. The table is constant by rows & columns and can be pasted below around 20 times. The table is consist of 13 rows and will be pasted next to eachother as in the file. How can the code simplified to get rid of "Long Procedure" error to be able to use in maximum 20 tables?
    Attached Files Attached Files
    Last edited by zrs; 02-24-2020 at 07:47 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help to shorten the macro

    Selam Arkadas.

    Your code is way way too repetitive.

    The first thing is your code should be more like:

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 02-24-2020 at 06:57 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Help to shorten the macro

    you do very similar things and these can be compacted into loops
    but the calculation you do in your code does not give the results shown in your table.
    so you may have to correct the formulas but you still can use the loop over each "block" (Period #)

    Another problem is that your rows AZ to B? are merged (always five rows merged into a single one).
    Here it is not possible to work with offset and therefore I had to use iFound1..4 (but is solved with this workaround)

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-22-2018
    Location
    Turkey
    MS-Off Ver
    Office2010
    Posts
    84

    Re: Help to shorten the macro

    Merhabalar. Thanks a lot for your quick reply. You' re right that so repetitive and long but can not find a solution how to come over applying each line without repeat. The figures and probably the multipliers may change in each line and my example includes 3 tables only but may lead up to 20. I' m really stucked to have a proper solution because error is inevitable if I prolonge the code. Hoscakalin

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Help to shorten the macro

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    HTH
    Regards, Jeff

  6. #6
    Registered User
    Join Date
    10-22-2018
    Location
    Turkey
    MS-Off Ver
    Office2010
    Posts
    84

    Re: Help to shorten the macro

    Dear Gue2013. Thanks a lot for your reply and solution. It really works well. Kind regards

+ 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] Help to Shorten this IF OR Macro
    By nordicdust in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-28-2018, 04:49 PM
  2. Help to Shorten this IF OR Macro
    By nordicdust in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2018, 02:55 PM
  3. Shorten this macro
    By madsklavsen in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-14-2017, 12:02 PM
  4. Macro to shorten data
    By dragonmaster in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 02-03-2015, 08:29 AM
  5. Shorten A Macro
    By JimmiOO in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-13-2010, 10:36 AM
  6. [SOLVED] How can i shorten this macro?
    By LMI in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-03-2006, 11:20 AM
  7. [SOLVED] Shorten a Macro
    By mully in forum Excel General
    Replies: 7
    Last Post: 12-30-2005, 02:00 PM

Tags for this Thread

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