Re: How to add alternating row colors in excel 2008
Re: How to add alternating row colors in excel 2008
- Subject: Re: How to add alternating row colors in excel 2008
- From: hd <email@hidden>
- Date: Sun, 30 Nov 2008 14:53:29 +0000
On 29 Nov, 2008, at 4:42, Tejo Waskito Effendi wrote:
I like the alternating row colors in Microsoft Office Excel 2008 and
I use it a lot.
I've tried to use record feature in Automator, but it results an
error.
However, it require me to type a formula to get it. So could you
please tell me how to automate it?
reference: http://support.microsoft.com/default.aspx?scid=kb;en-us;268568
Hi,
You can use an AppleScript in a "Run AppleScript" Automator action.
on run {input, parameters}
tell application "Microsoft Excel"
activate
activate object worksheet 1
set row_formatter to (make new format condition at selection with
properties {format condition type:expression, condition
operator:operator equal, formula1:"=MOD(ROW(),2)=1"})
set color of interior object of row_formatter to {250, 0, 250}
end tell
end run
Copy and paste this script into your action.
A few things to note
* One long single line:
set row_formatter ... =1"})
may get split up by your email client.
* Change the numbers in {250, 0, 250} for different RGB colours.
* This has been tested in Excel 2008 and will certainly not work for
versions earlier than Excel 2004.
* If you run the action more than once on the same selection without
removing the conditional formatting it will not change the colour.
This is because only the first condition will apply.
*If you run the action more than three times on the same selection
without removing the conditional formatting you will get an error
because no cell can have more than three conditions applied to it.
Hope this helps.
HD
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden