Author: Jonas Bilinkevicius
How to search an Excel worksheet for cells with a particular value
Answer:
If WS is your worksheet:
1 { ... }2 var3 Rnge: OleVariant;
4 { ... }5 6 Rnge := WS.Cells;
7 Rnge := Rnge.Find('Is this text on the sheet?');
8 if Pointer(IDispatch(Rnge)) <> nilthen9 {The text was found somewhere, so colour it pink}10 Rnge.Interior.Color := clFuchsia;