I simply cant find a solution to this:
In Microsoft Excel 2016 for OSX I would like to make a script that:
¢ Adds left cell border (line at left in cell)
Have succesfully used this to remove borders, but cant see how to modificate it to add borders:
tell application “Microsoft Excel”
set mySel to selection
set myRange to first item of (get areas of mySel)
set myBorders to {border top, border bottom, border left, border right}
repeat with i from 1 to 4
set theBorder to get border myRange which border (item i of myBorders)
set line style of theBorder to line style none
end repeat
end tell
Browser: Safari 600.8.9
Operating System: Mac OS X (10.10)
There are several properties that control the looks of borders. I suggest you read the relevant bits in the Excel AppleScript Reference. Get it here. That said, here’s one way to show borders on selected cells:
tell application "Microsoft Excel"
set mySel to selection
set myRange to first item of (get areas of mySel)
set myBorders to {border top, border bottom, border left, border right}
repeat with i from 1 to 4
set theBorder to get border myRange which border (item i of myBorders)
set weight of theBorder to border weight thin
end repeat
end tell
The Reference will show you how to manipulate the border’s appearance.
At least check Excel’s dictionary (via cmd-shift-L in Script Editor) to see the available terminology for a border’s properties.