Results 1 to 2 of 2

Thread: speed macro using array

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    2

    speed macro using array

    hye all,

    I have to do a project which required me to get specific data from a large excel doc. i use filtering function but it takes me about 20 minutes to come out with the result. I know we can do it using array, but i don't know how to do it. for example, i want a data from country : xxxx, account name : yyyy unit:zzzz revenue :1234, these data i have to paste it to another worksheet, now i'm using macro and it is very slow. what i'm not rite now is juz record a macro, that's why it is slow. can sumbody help me to speed up my process?i'm am more than happy to receive your help.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: speed macro using array

    to increase speed of existing macro, try
    applicatrion.screenupdating = false
    ' all your code
    application.screenupdating = true

    how much speed you will gain is very hard to say, but you can try to see if any noticeable difference
    if you are using select in your macro that will also slow it down, try to avoid selecting ranges, just work with the range specifying it's address
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

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



Click Here to Expand Forum to Full Width