• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Scripting in Excel -> search different words in column and color them
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Scripting in Excel -> search different words in column and color them
      • From: David Wignall <email@hidden>
  • Prev by Date: Re: using apple script
  • Next by Date: Re: User Name in OS X
  • Previous by thread: RE: Scripting in Excel -> search different words in column and color them
  • Next by thread: Re: Scripting in Excel -> search different words in column and color them
  • Index(es):
    • Date
    • Thread