+ Reply to Thread
Results 1 to 8 of 8

Search range for value and change to a value

  1. #1
    Registered User
    Join Date
    01-06-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    41

    Search range for value and change to a value

    Hello everyone,

    What would a macro look like if I wanted the macro to search a cell range for a value and then change the cell to a value. For instance lets say I would like a macro to search from A1:CD100 for the cell value Mic and change it to Michael. So if AD50 had the value Mic the macro would change it to Michael.

    Thanks for the help.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Search range for value and change to a value

    Something like this?
    Please Login or Register  to view this content.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,033

    Re: Search range for value and change to a value

    try this:

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    01-06-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Search range for value and change to a value

    Thanks,

    Is it possible for the macro to automatically run whenever I change a cell value in that range or any range.

    Thanks

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,033

    Re: Search range for value and change to a value

    Put this in a worksheet change event. It should not be in a normal module.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-06-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Search range for value and change to a value

    Thanks!!

    Is there a way to make it case insensitive. Essentially it would do the same thing for MIC, mic, Mic etc. I tried to search online for a way to do that but I turned up nothing.

    Michael

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Search range for value and change to a value

    Another:

    Please Login or Register  to view this content.
    Works for all variations.

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,033

    Re: Search range for value and change to a value

    Above the Sub line in the code, type

    Please Login or Register  to view this content.
    This will treat upper and lower case the same.

+ 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. Creating search box in cell - Currently using Macro 'Range to search' *HELP*
    By jacko058 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-14-2014, 05:24 AM
  2. Modify this Search Formula to search across a range of cells
    By zicitron in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-16-2013, 08:11 AM
  3. Search range of strings with a range of keywords and highlight matches
    By efillner in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2013, 04:07 PM
  4. Replies: 5
    Last Post: 03-20-2012, 09:12 PM
  5. CAN YOU DYNAMICALY CHANGE VLOOKUP SEARCH RANGE?
    By njuneardave in forum Excel General
    Replies: 3
    Last Post: 06-21-2006, 02:45 PM

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