+ Reply to Thread
Results 1 to 6 of 6

Macro for massive search-replace by coolumns

  1. #1
    Registered User
    Join Date
    02-26-2017
    Location
    London
    MS-Off Ver
    16
    Posts
    11

    Macro for massive search-replace by coolumns

    Hello,

    I have a massive excel files (2 sheets, 700.000 lines earch, in 10 columns). My sheets are called 'sheet1' and 'sheet2'

    I need to replace some words in the columns by numbers, to create variables that i can analyze.

    The columns on the which are work are, for instance, this one:
    HTML Code: 

    I have this macro, i think i can adapt it, but there are two problems:

    1) this macro replaces in all the file, not in the columns, and "1" in column 4 does not mean "1" in column "4" (it's not the same word that is replaced)
    2) I'm afraid this won't work on a big file, it's not optimized at all.

    HTML Code: 

    I give you a file of the words i need to replace and of the columns, so you see a bit how painful it can be.
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: Macro for massive search-replace by coolumns

    Rather than use VBA and, potentially corrupt the original data (unknowingly) if the data is changed out of sequence, why not have a separate (copy) sheet and use VLOOKUP with the conversion tables you have to change the values? You retain the original data but can analyse the data on the copy sheet.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    02-26-2017
    Location
    London
    MS-Off Ver
    16
    Posts
    11

    Re: Macro for massive search-replace by coolumns

    Hum yea I see.
    That would be a bit longer to do, but indeed, its safe. I fear I could have errors though, because they might be empty cells in columns, and that file is so heavy
    Last edited by Ayadin1; 02-28-2017 at 07:57 AM.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: Macro for massive search-replace by coolumns

    Easier and safer to try it first without VBA. You could do a column at a time and Copy and Paste Special | Values to get rid of the formulae and the performance overhead. When it's all converted, you could copy, or move, the new sheet to a new workbook so you could analyse the data without having two copies present.

    Just a thought

    If you did want to use VBA and do one column at a time, you could adapt this code.

    Please Login or Register  to view this content.
    Of course, make a copy of the workbook before you destroy/edit it

  5. #5
    Registered User
    Join Date
    02-26-2017
    Location
    London
    MS-Off Ver
    16
    Posts
    11

    Re: Macro for massive search-replace by coolumns

    I will try to add columns and do the VLOOKUP thing on the file. Indeed it's simpler, i just hope my computer can compute all this.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: Macro for massive search-replace by coolumns

    The VBA option should be quite fast. Make a copy of your workbook and try it.

+ 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] Best functon to search for two values in a massive row
    By TCS111 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-10-2013, 04:21 AM
  2. Massive Find and Replace Problem
    By commanderyeti in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2011, 03:34 PM
  3. search & replace macro
    By LiamF in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-04-2010, 02:41 PM
  4. Search function in massive database
    By Marvlin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-03-2008, 05:57 PM
  5. Massive search / find / highlight function
    By zaptiri in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2008, 06:29 AM
  6. [SOLVED] How to create a massive find & replace macro
    By JWCrosby in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-18-2006, 03:40 PM
  7. search massive
    By lynch44 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-26-2006, 09:10 PM
  8. Massive Replace/Delete?
    By mdudlik in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-25-2005, 02:39 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