Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Compare strings in cells and highlight difference

I am new to Macros and I have failed to write one to compare 2 cells
and highlight the difference between the strings in those cells. The
one tried highlighted the whole cell instead.

Compare string in column B to Column A and return the different
character in column C and the position of that character in column D.
This must be possible for multiple characters/positions. Is it possible
to highlight (bold/different colour) the different character as well.
For example:-

A B C D
1 A6ABC A67ABC 7 3
2 A7ABC A557ABC 5, 5 2, 3
3 12AAC R126AAC R, 6 1, 4
4 D4CBT LF04CBT L, F,0 1, 2, 3
5 2811D 28MD M 3


Thanking you in advance,

Odin

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Compare strings in cells and highlight difference

Hi odin,

For the first row in your example the code is this:

Range("B1").Select
ActiveCell.Characters(Start:=Range("D" & ActiveCell.Row),
Length:=1).Font.FontStyle = "Bold"

Try to write a macro based on this code to do the whole job!

Regards,
Stefi

€˛Odin€¯ ezt Ć*rta:

I am new to Macros and I have failed to write one to compare 2 cells
and highlight the difference between the strings in those cells. The
one tried highlighted the whole cell instead.

Compare string in column B to Column A and return the different
character in column C and the position of that character in column D.
This must be possible for multiple characters/positions. Is it possible
to highlight (bold/different colour) the different character as well.
For example:-

A B C D
1 A6ABC A67ABC 7 3
2 A7ABC A557ABC 5, 5 2, 3
3 12AAC R126AAC R, 6 1, 4
4 D4CBT LF04CBT L, F,0 1, 2, 3
5 2811D 28MD M 3


Thanking you in advance,

Odin


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare two Cells and highlight third cell Timmy Excel Worksheet Functions 3 November 21st 07 08:38 PM
How do you compare 2 list of numbers and highlight the difference Jay Jones Excel Programming 1 March 20th 06 04:49 PM
How do you compare 2 list of numbers and highlight the difference Tom Ogilvy Excel Programming 0 March 20th 06 02:50 PM
Compare two worksheets and highlight the one sheet’s difference from the other one minrufeng[_13_] Excel Programming 1 February 24th 06 10:19 PM
Compare cells/columns and highlight matching text strings luxbelle Excel Worksheet Functions 1 February 25th 05 06:34 PM


All times are GMT +1. The time now is 02:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"