

Moving from Microsoft Office VBA to AppleScript:
MacTech's Guide to Making the Transition
Introduction
|
Table of Contents
Page Prev and Page Next buttons at bottom of the page.
|
April, 2007
Page 78
'Format Legend
.HasLegend = True
With .Legend
.Position = xlRight
With .Border
.Color = vbBlue
.LineWeight = 1
.LineStyle = xlContinuous
.Transparency = 0
End With
With .Fill
.Visible = True
.ForeColor.RGB = RGB(150, 200, 255)
.Transparency = 0.5
End With
With .Font
.Name = "Arial"
.Size = 10
.ColorIndex = 5
End With
End With
End With
End With
End Sub
And here is the AppleScript of the same (make it on another sheet if you try both).
tell application "Microsoft Excel"
--dynamically grab the data in columns
tell active sheet
--Find the headers in the first row:resize range A1 to last used cell of row 1
set rHeaders to get resize range "A1" column size ¬
(first column index of (get end (cell (count columns) of row 1) ¬
direction toward the left))
--Now find the number of data rows
--and set rData to whole range from row 2
set rData to get resize range ("A2:A" & first row index of (get end ¬
range ("A" & (count rows)) direction toward the top)) ¬
column size (count (columns of rHeaders))
if (count (columns of rHeaders)) = 1 or (count (rows of rData)) = 1 then ¬
return -- no data, so quit
< Previous Page Next Page>

- SPREAD THE WORD:
- Slashdot
- Digg
- Del.icio.us
- Newsvine