|
▼あくたいおん さん:
こんばんは。
新規ブックの標準モジュールに
'====================================================
Sub ふきだし()
Dim vLeft, vtop, vHeight, vWidth As Long
Dim txt As String
Dim svx As Double, svy As Double
With ActiveCell '位置調整
vLeft = .Left + .Width + 22
vtop = .Top - 15
vHeight = 10
vWidth = 50
End With
With ActiveSheet.Shapes.AddShape(msoShapeLineCallout3, vLeft, vtop, vWidth, vHeight)
.Fill.ForeColor.RGB = RGB(255, 204, 204)
With .Line
.ForeColor.SchemeColor = 20
.BeginArrowheadStyle = msoArrowheadOval
.EndArrowheadStyle = msoArrowheadOval
End With
DoEvents
MsgBox "初期位置だよ"
svx = Round((.Adjustments(1) * .Width + .Left) / 0.75, 0) * 0.75
svy = Round((.Adjustments(2) * .Height + .Top) / 0.75, 0) * 0.75
'↑ポイント1は、この上記の式なにやっているか解読してね
With .TextFrame
With .Characters
.Text = ""
With .Font
.Name = "MS Pゴシック"
.Size = 8
End With
.Text = "あああああああああああああ" & vbCrLf & _
"いいいいいいいいいいいいい" & vbCrLf & _
"うううううううううううううう" & vbCrLf & _
"ええええええええええええええ"
End With
.AutoSize = True
End With
.Adjustments(1) = (svx - .Left) / .Width
.Adjustments(2) = (svy - .Top) / .Height
' ↑ポイント2は、上記の式で自動サイズ調整後に再設定しています。
End With
End Sub
確認してみてください
|
|