+ Reply to Thread
Results 1 to 13 of 13

Trouble with arrays

  1. #1
    Forum Contributor colddeck84's Avatar
    Join Date
    06-18-2016
    Location
    bergen, norway
    MS-Off Ver
    2016
    Posts
    254

    Trouble with arrays

    Hi I was wondering if someone could help me write data from one array to another and then print result to the worksheet.
    I have made this code which writes directly from the first array to the worksheets , it works but its to slow so that´s why I think printing from an array would be much faster.

    Please Login or Register  to view this content.
    I have tried making the 2nd array myself but I has some error and does not work as intended, I have commented it out

    any help to complete this sub would be much appreciated

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

    Re: Trouble with arrays

    Hi colddeck84

    Why not upload a sample file members can make use of with before and after result depicted...
    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!!!

  3. #3
    Forum Contributor colddeck84's Avatar
    Join Date
    06-18-2016
    Location
    bergen, norway
    MS-Off Ver
    2016
    Posts
    254

    Re: Trouble with arrays

    Hi sintek thanks for your reply , I have added a sample please see the attached. Working code in module1
    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: Trouble with arrays

    What are you actually trying to achieve...

    All info meeting criteria i.e date - 6 days i.e. 16 March onwards to columns Q and then what...

  5. #5
    Forum Contributor colddeck84's Avatar
    Join Date
    06-18-2016
    Location
    bergen, norway
    MS-Off Ver
    2016
    Posts
    254

    Re: Trouble with arrays

    Yes the sample is working however it prints trough a loop to the sheet which is quite slow. Actually I think I have solved it myself here is the for faster print

    Please Login or Register  to view this content.


    this is at least 10 times faster.

    Edit:
    Please Login or Register  to view this content.
    Last edited by colddeck84; 04-22-2019 at 05:00 AM.

  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: Trouble with arrays

    Another option...
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor colddeck84's Avatar
    Join Date
    06-18-2016
    Location
    bergen, norway
    MS-Off Ver
    2016
    Posts
    254

    Re: Trouble with arrays

    Your code also works although it missed one criteria (ticket number but not so important) .

    Excellent work it also ran in 0,02 sec but code with the fewest rows is always the best +rep for you , and thread solved

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

    Re: Trouble with arrays

    although it missed one criteria (ticket number but not so important) .
    This part fills the ticket no...
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor colddeck84's Avatar
    Join Date
    06-18-2016
    Location
    bergen, norway
    MS-Off Ver
    2016
    Posts
    254

    Re: Trouble with arrays

    great, thanks

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

    Re: Trouble with arrays

    Glad you got it sorted...Tx for rep...

  11. #11
    Forum Contributor colddeck84's Avatar
    Join Date
    06-18-2016
    Location
    bergen, norway
    MS-Off Ver
    2016
    Posts
    254

    Re: Trouble with arrays

    Actually there is something wrong with my code. Altough your code is great I would really like to solve it with the array method as this will increase my knowledge level with arrays .

    Here the code is updated to find result from a full month

    Please Login or Register  to view this content.
    This was unexpected as the code works perfectly when looking for last 7 days
    Last edited by colddeck84; 04-22-2019 at 06:57 AM.

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

    Re: Trouble with arrays

    Haven't had chance to look at your new code ... this was from earlier before I supplied filter code...
    Please Login or Register  to view this content.

    Edit...Just incorporate your new code for date...
    Please Login or Register  to view this content.
    Last edited by Sintek; 04-22-2019 at 08:15 AM.

  13. #13
    Forum Contributor colddeck84's Avatar
    Join Date
    06-18-2016
    Location
    bergen, norway
    MS-Off Ver
    2016
    Posts
    254

    Re: Trouble with arrays

    Your code works great double rep for you . I would need to study this a little to see where I went wrong , anyway

+ 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. Declaring multiple multi-dimensional arrays (jagged arrays) - compile error?
    By dfribush in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-20-2013, 05:06 PM
  2. [SOLVED] New to arrays-where do I find a good beginners guide to multi dimensional arrays
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-04-2013, 07:44 PM
  3. [SOLVED] Trouble Looping Multiple Column Arrays
    By D.L. in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-23-2012, 03:32 AM
  4. Having trouble with refering to arrays
    By SuitedAces in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-04-2007, 02:28 PM
  5. Arrays - declaration, adding values to arrays and calculation
    By Maxi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2006, 11:15 AM
  6. Trouble with Arrays / Collections
    By John in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-07-2005, 03:05 PM
  7. trouble returning text values using IF and arrays
    By speakeasy78 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-24-2005, 11:31 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