|
▼ABC さん:
ん...深く考えず単純に挿入するとしたら
>>Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
>> Dim l_rng As Range
Dim L As Single
Dim T As Single
>> If Target.Count <> 1 Then
>> MsgBox "単一セルに限ります"
>> Exit Sub
>> End If
>> If f_rng Is Nothing Then
>> Set f_rng = Target
>> Application.StatusBar = "直線の終点を右クリックしてください"
>> Else
>> If f_rng.Left > Target.Left Then
>> Set l_rng = f_rng
>> Set f_rng = Target
>> Else
>> Set l_rng = Target
>> End If
> With Me.Lines.Add(f_rng.Left + f_rng.Width, f_rng.Top, _
> l_rng.Left, l_rng.Top)
> .ShapeRange.Line.Weight = 0.5
.Height = 0
L = .Left + .Width / 2
T = .Top
End With
With Me.TextBoxes.Add(L - 8, T, 16, 16)
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
> End With
>> Set f_rng = Nothing
>> Application.StatusBar = False
>> End If
>> Cancel = True
>>End Sub
こんな感じ...
|
|