Hey that’s great. I’ve tweak the GREP a little so what is selected is more exact.
var
textInCell=[‘Corporate’, ‘Scotland’, ‘South West’, ‘London South & South East’, ‘Powered Access’, ‘Rail’, ‘Traffic’, ‘Leada Acrow’, ‘PSS Hire’, ‘FLG Services’, ‘Health & Safety & Training’];
var myRegEx = new RegExp(“^(“+textInCell.join(“|”)+”)$”);
for (i=0; i<table.cells.length; i++)
{
if (table.cells[i].texts[0].contents.match(myRegEx))
table.cells[i].appliedCellStyle = “District Cell”;
}
I’ve got one other element to add in to my table formatting. I want to find a cell with the word ‘Budget’ (but this may be written as ‘Budget:’ or ‘Budget: (E)’ – but without the speech marks) and apply the Cell Style – SponsorCellStyle – to the whole row. I’ve currently got this going on, but it isn’t working:
//Find Text in Cell and apply Cell Style to Row
for (i=0; i<table.cells.length; i++)
{
if (table.cells[i].texts[0].contents == “Budget:”)
table.rows.everyItem().appliedCellStyle= “Sponsor/Owner Cells”;
}
Could you possibly help with this last bit?