+ Reply to Thread
Results 1 to 3 of 3

Macro To Compare Two Cell Values

  1. #1
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Macro To Compare Two Cell Values

    I have an Excel worksheet where people input there name, the issue that I am running into is that some people are not properly adding in the data. So data will look like this
    Please Login or Register  to view this content.
    As you can see the SR was input for both the Name and EXT. To clean this up, how would I use VBA to check the value of EXT and if it exists in the Name field then update EXT to blank?

    I am attaching a workbook with sample data, and my desired output to better illustrate.

    Thanks in advance!

    Also - this is a subset of data, the lastrow would need to be determined through the VBA syntax, not just hardcode values pulez.
    Attached Files Attached Files
    Last edited by jo15765; 03-08-2017 at 01:29 PM.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Macro To Compare Two Cell Values

    Something like this?
    Please Login or Register  to view this content.
    NOTE: It is case sensitive. If you don't care about case, change vbBinaryCompare to vbTextCompare

  3. #3
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Macro To Compare Two Cell Values

    Yes, perfect. thank you.

+ 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] Run formulas with macro but compare values in cell
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-21-2014, 01:33 PM
  2. [SOLVED] Compare cell values of different Workbooks and prompt message using macro
    By jericlapuz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2012, 03:42 AM
  3. Compare the cell values in two different workbooks and copy values from one to the other
    By BettyBoop64 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-10-2012, 04:48 PM
  4. [SOLVED] Macro to find, compare and copy values.
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-15-2012, 02:10 PM
  5. [SOLVED] compare cell value with range of values and match row values with header
    By bujji1305 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-08-2012, 12:19 AM
  6. [SOLVED] Macro Help to Compare Values in Two Separate WorkBooks
    By RePete in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-25-2006, 11:30 AM
  7. Need a macro to compare values in a workbook
    By DVnet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-28-2005, 09:06 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