Re: Scripting in Excel -> search different words in column and color them
Re: Scripting in Excel -> search different words in column and color them
- Subject: Re: Scripting in Excel -> search different words in column and color them
- From: bill <email@hidden>
- Date: Thu, 24 Oct 2002 16:46:23 +0800
>
I want to search in 5 columns the word "missing" or "FALSE" or "empty" and
>
if it is found color it red and set the font to bold
Assume that you already know the range to search these words, this approach
is to compose a list of each cell name (e.g. R1C1, R1C2,...); then loop
through each cell and do comparison.
You need to consider if you type 3false2 manually into a cell, Excel treats
it as boolean, only if you type 39false2 (a single quote preceding false),
Excel treats it as string.
Here9s the script:
set sRange to {}
repeat with rowN from 1 to 100
repeat with columnN from 1 to 5
set end of sRange to "R" & rowN & "C" & columnN
end repeat
end repeat
tell application "Microsoft Excel"
Activate
Select Sheet "Sheet1"
repeat with i in my sRange
if Value of Cell i is in {"missing", "FALSE", false, "empty"} then
set {ColorIndex of Font of Cell i, Bold of Font of Cell i} to
{3.0, true}
end if
end repeat
end tell
bill
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.