+ Reply to Thread
Results 1 to 2 of 2

Text compare

  1. #1
    Registered User
    Join Date
    02-08-2015
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    2

    Unhappy Text compare

    Hi. Im bit of a noob so please go easy. I have a line of text in A1 and a very similar, but different, line of text in B1. I want to grab B1 and paste it into C1 and highlight, or bold whatever, every difference in B1 from A1. Preferably down to character, space, upper\lower case etc. I search the internet and found the below VBA which when reading it seems to make sense. However when I try to run it I get syntax errors when compiling I think on line "If (ActiveSheet.Range("A1").Characters(i, 1).Text <>"

    Can anyone help with this syntax problem? Im not a VBA guy but I use Google and I cant find the smoking gun.

    Please Login or Register  to view this content.


    Also one other thing. Assuming I can get this to work i'd then like to run it across a range of rows in one go. e.g. From A1:B1 through to A100:B100 etc. How do i loop it like that?

    Thanks.
    Last edited by FDibbins; 02-08-2015 at 08:45 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Text compare

    Hi, welcome to the forum

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    I have added them for you - this time
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Compare two excel and mismatch text should be display in red color and match text in green
    By aadityapatel1984 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-01-2014, 04:22 PM
  2. [SOLVED] Compare multi-line text cell to data in much larger text file
    By Rhudi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-30-2013, 05:19 PM
  3. Replies: 6
    Last Post: 02-28-2013, 11:27 AM
  4. Compare two text cells and extract common text words
    By ghost_chip in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-28-2012, 06:07 AM
  5. Replies: 6
    Last Post: 06-08-2012, 06:54 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