Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello!
I would like to know how can I write a VBA macro to execute the following. Given two strings of characters having the same length, I need a function that compares each couple of characters in the same position of the initial strings and gives back as a result a string equal to the first input string but with the characters, that are different compared with input string number two, written in bold font. Example: string1: A B C D E F string2: A B C W E F result of the formula: A B C [bold]D E F since the first positions are both A, the second positions are both B, the third are both C, the fifth are both E and the sixth are both F. BUT the fourth positions differ, and so I can highlight that in string 1 there is the fourth position changed. How can I write the code? I can easily use the Mid function to extract the characters in each position, under a loop with "i" changing from 1 to the length of the sequences (with the Len function). But I don't know how to change the style of the font if the character is different between string1 and string2... Can somebody help me? Thank you very much!!! Antonio Riva. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If Statement with 9 sequences | Excel Discussion (Misc queries) | |||
Comparing the first 2 characters of a coloumn to a string | Excel Worksheet Functions | |||
Comparing characters in one cell to multiple cells | Excel Worksheet Functions | |||
Save as: sequences? | Excel Discussion (Misc queries) | |||
Event Sequences | Excel Programming |