+ Reply to Thread
Results 1 to 7 of 7

Faster way to find and replace multiple values with corresponding values

  1. #1
    Registered User
    Join Date
    06-14-2013
    Location
    CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    24

    Faster way to find and replace multiple values with corresponding values

    I currently have a macro, which I recorded, that finds a value and replaces it with another. There are about 20 things that I want to find and replace, which takes a while because it does each one after the other. Is there a way to put them in an array and loop through to make the process run faster? A bit of the code is below.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Faster way to find and replace multiple values with corresponding values

    hi babbeleme1, example:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-14-2013
    Location
    CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Faster way to find and replace multiple values with corresponding values

    It works perfectly. Still a bit slow for my liking, but at least faster than mine. Thank you so much watersev!

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Faster way to find and replace multiple values with corresponding values

    to make it faster:
    1. Do not use Cells...., define exact range
    2. Add before For .. next
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-14-2013
    Location
    CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Faster way to find and replace multiple values with corresponding values

    Oh okay! Turning screenupdating off will just make it all come up at once, right?
    What do you mean by "Do not use Cells....define exact range" ?

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Faster way to find and replace multiple values with corresponding values

    I doubt you use around 1000000 rows by around 32000 columns data block. Using
    Please Login or Register  to view this content.
    would instruct Excel to check all those millions which I'm sure ar not used even halfly

  7. #7
    Registered User
    Join Date
    06-14-2013
    Location
    CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Faster way to find and replace multiple values with corresponding values

    Great! Made both changes and it's significantly faster. Thank you so much watersev!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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