エクセルで選択範囲の中央に矢印を簡単に引くマクロです
保証とかは何もありません。
使う場合は全てにおいて自己責任にでお願いします。m(__)m
先頭矢印
Sub AutoLine1()
' Keyboard Shortcut: Ctrl+Shift+L
' 先頭矢印の自動作成
'
Dim TP, LF, WD
TP = Selection.Top + (Selection.Height / 2)
LF = Selection.Left
WD = Selection.Width
ActiveSheet.Shapes.AddLine(LF, TP, LF + WD, TP).Select
Selection.ShapeRange.Line.BeginArrowheadStyle = msoArrowheadTriangle
ActiveCell.Select
End Sub
終端矢印
Sub AutoLine2()
' Keyboard Shortcut: Ctrl+Shift+R
' 終端矢印の自動作成
'
Dim TP, LF, WD
TP = Selection.Top + (Selection.Height / 2)
LF = Selection.Left
WD = Selection.Width
ActiveSheet.Shapes.AddLine(LF, TP, LF + WD, TP).Select
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
ActiveCell.Select
End Sub
上マクロを有効にするには~~~
以下を記述しておきます。
ついでに間違って押しやすいF1(ヘルプ)を無効にしておきました。
キーのショートカット設定
Sub auto_open()
' F1キーを無効にする。
Application.OnKey "{F1}", ""
' Ctlr+Shift+L = 矢印先頭
Application.OnKey "+^{L}", "AutoLine1"
' Ctlr+Shift+R = 矢印終端
Application.OnKey "+^{R}", "AutoLine2"
End Sub
これで見積もりやプロジェクトのスケジュールが
はやくできるかな~
