Skip to content

Instantly share code, notes, and snippets.

@AJABON
Last active January 17, 2026 07:48
Show Gist options
  • Select an option

  • Save AJABON/96b2fe4e24ee6defc0b28120400cf040 to your computer and use it in GitHub Desktop.

Select an option

Save AJABON/96b2fe4e24ee6defc0b28120400cf040 to your computer and use it in GitHub Desktop.
セルの値を取得してそのセル内に棒グラフっぽく段落境界線を引くやつ
// くわしくは以下で
// https://ajabon.catfood.jp/?p=2888
var sel = app.selection[0].cells;
for (var i = 0; i < sel.length; i++) {
var cellWidth = sel[i].width;
var val = sel[i].texts[0].contents.match(/^\d+[\d\.]*$/) == null? 0 : eval(sel[i].contents);
var barDistance = cellWidth - cellWidth / 100 * val;
sel[i].paragraphs[0].ruleAboveRightIndent = barDistance;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment