Re: why>?



dbahooker@xxxxxxxxxxx wrote...
UPDATE XLS_FORMULAS
SET FormulaText = replace(formulatext, 'TRIM', 'LTRIM')
WHERE Worksheet = ''sheet1' and row = 'A' AND formulatext like NOT LIKE
'LTRIM'

you see harlan?

my formulas are infinitely customizable.
....

Incremental refinement is good. Pity you failed to fix the row equals
letter bug. Using LIKE is nice, but how would you change references
like A1001 to A2001 while leaving numeric constants 1001 and cell
references A10010 unchanged? That is, replace references into
A1001:A1999 with references into A2001:A2999 where A1001 becomes A2001,
A1002 becomes A2002, etc.? Using regular expressions it's just

re.Pattern = "(\W)(\$?[A-Z]{1,2}\$?)1([1-9]\d{2}|\d{2}[1-9])\b"
..Formula = re.Replace(.Formula, "$1$22$3")

This is just a purely textual replacement. I could have used re.Execute
and used the Submatches collection to extract the row number, applied a
numeric transformation, then rebuilt the formula.

Try doing this with SQL's toy LIKE operator.

Learn some REAL text processing tools, you query-spewing,
SQL-thumb-sucking baby!

.