角丸マクロ


Sub 角丸()
Dim tmpText As String
Dim shapeRadius As Integer
Dim flag As Boolean
Dim roundedRectangle As Shape

flag = False

Do
tmpText = InputBox("角丸四角形の半径を入力してください")
If StrPtr(tmpText) = 0 Then
Exit Sub 'キャンセル時は終了
End If
shapeRadius = Val(tmpText) '数値に変換
If shapeRadius <= 0 Then
MsgBox "0以上の数値を設定してください"
Else
flag = True
End If
Loop Until flag = True

With ActiveWindow.Selection
If .Type = ppSelectionShapes Then
For Each roundedRectangle In .ShapeRange
With roundedRectangle

If .Width < .Height Then
.Adjustments(1) = shapeRadius / .Width
Else
.Adjustments(1) = shapeRadius / .Height
End If
End With
Next roundedRectangle
End If
End With
End Sub
お知らせ
実務でも趣味でも役に立つ多機能Webツールサイト【無限ツールズ】で、日常をちょっと便利にしちゃいましょう!
無限ツールズ

 
writening