Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 22 of 22

Thread: Improve Efficiency of VBA Code

  1. #21
    Many thanks M. Paul_Hossler for your time again.
    Another try
    I have written the code below It is working well but it takes too long time althought I used arrays
    but After testing the code on the original file. It gave me a run-time error '13' a type mismatch In this line
         Let arrOut() = Application.Index(arrIn(), Rws(), Clms())
    What are the reasons about this error? In your view sir
    I apologize for my question. but I trying to figure this out for a few hours and can no longer the thinking.
    Appreciate your help and thank you in advance.
    Attached Files Attached Files
    Last edited by jonsonbero; 05-27-2020 at 10:08 AM.

  2. #22
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    I don't get an error and the results seem to be OK

    I did restructure your macro a little so that I could single step through it
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •