LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Comparison Macro + In string text highlighting

Hi all,

I currently have a macro that compares the differences between two
workbooks' formulae (using .formulaR1C1), and it eventually makes a list on a
new workbook in the following format:

Column 1 = first column's formulae, as a string
Column 2 = second column's formulae, also as a string.

So for example, an output for column 1 could be:

'=(R[-40]C+R[-26]C+R[-4]C)/(1+VLOOKUP(R[-140]C4,Table.GST,Tables!R902C5))*VLOOKUP(R[-140]C4,Table.GST,Tables!R902C5)

compared to column 2:

'=(R[-40]C+R[-26]C+R[-4]C)/(1+VLOOKUP(R[-264]C4,Table.GST,Tables!R902C6))*VLOOKUP(R[-264]C4,Table.GST,Tables!R902C6)

That part works smoothly enough, outputting the formula as plain black text.
However, what I want to do is to actually highlight the difference in
formulae IN the two cells by having the differences being bolded, and made
into red font. Not shading the cells, but having the text string inside the
cell being a mixture of normal black font and bold red font.

I've seen this done before, but can anyone please shed some light on these
two issues?

1) What would be the most ideal way of finding the difference between the
two formulae? If the structure of the formulae remain the same with only the
column and row numbers changing, that is easily done by comparing the
formulae character by character. However, I want it to be flexible enough to
detect it when characters are deleted/inserted.

2) How do you actually have a string in a cell that have some parts bolded
as red, while others are normal font, etc? I've seen this done before, so it
should be possible.

Thanks all!

--
Location: Sydney
Occupation: Actuarial Consultant (Project Finance/Financial Modeling)
 
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
Complicated comparison and highlighting question Aimee Excel Worksheet Functions 0 July 3rd 08 01:15 AM
String Comparison Shaves Excel Programming 1 May 23rd 08 12:51 AM
Text string comparison - closest match pappu Excel Discussion (Misc queries) 1 July 6th 06 04:23 AM
Text comparison issue in macro...help!!! Celt[_18_] Excel Programming 2 March 14th 06 04:18 PM
String Comparison Purnima Excel Programming 9 March 8th 05 11:13 AM


All times are GMT +1. The time now is 08:37 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"