I only program in Excel vba occassionally so am not conversant
with all the techniques! I am interested in whether a function written
to sit in a spreadsheet cell is capable of altering the appearance of
the cell itself and the formatting of the text which the function
returns. To make this easier to grasp, say I have strings '1234' in B1
and '124' in C1. From these inputs I want =Compare(B1,C1) sitting in D1
to produce a string '1234' (where the third character is bold and in a
different colour) to indicate it exists in the first input but not the
second. I would also like to change the cell's background colour
according the the number of differences between the two inputs (8
maximum).
I know that Excel only allows a spreadsheet function to alter the cell
to which the result is returned, but have found that I can leave a
series of results in an public array for other cells to pick up. Using
this I have successfully placed a formula
=DoMatrixManipulation(A4:C25,E4:G25) in one cell and then populated
J4:L25 with a function =ReadResult(Row()-r,Column()-c,TriggerCell) to
pick up the array elements. (I do this to to prevent Excel needlessly
recalculating every cell at each new user input, as by controlling the
contents of the trigger cell, the results range is only refreshed when
it needs to be.)
This is where I suspect I could achieve more if only if I knew how!