For Each で総当りで調べている。
シェイプの名前: Name
表示: Visible
左位置: Left
上位置: Top
幅: Width
高さ: Height
角度: Rotation
線の太さ: Line.Weight
点線のスタイル: Line.DashStyle
線種: Line.Style
線の透明度: Line.Transparency
線の表示: Line.Visible
線色: Line.ForeColor.RGB
塗りつぶし: Fill.Visible
塗りの透明度: Fill.Transparency = 0
塗りつぶし色: Fill.ForeColor.RGB
シェイプの名前: Name
表示: Visible
左位置: Left
上位置: Top
幅: Width
高さ: Height
角度: Rotation
線の太さ: Line.Weight
点線のスタイル: Line.DashStyle
線種: Line.Style
線の透明度: Line.Transparency
線の表示: Line.Visible
線色: Line.ForeColor.RGB
塗りつぶし: Fill.Visible
塗りの透明度: Fill.Transparency = 0
塗りつぶし色: Fill.ForeColor.RGB
Private Sub ExShape()
Dim t As Object
Dim s As String
For Each t In Sheets("Sheet3").Rectangles
'シェイプの名前
s = t.Name
If s = "Rectangle 1" Then
'表示
t.Visible = True
'位置
t.ShapeRange.Left = 132
t.ShapeRange.Top = 135
t.ShapeRange.Width = 49.5
t.ShapeRange.Height = 88.5
'角度
t.ShapeRange.Rotation = 0
'線 太さ
t.ShapeRange.Line.Weight = 0.75
'点線のスタイル
t.ShapeRange.Line.DashStyle = msoLineSolid
'線種
t.ShapeRange.Line.Style = msoLineSingle '1本線
'透明度
t.ShapeRange.Line.Transparency = 0 '0.0 (不透明) ~ 1.0 (透明)
'線の表示
t.ShapeRange.Line.Visible = True
'線色
t.ShapeRange.Line.ForeColor.RGB = RGB(255, 0, 0)
'塗りつぶし
t.ShapeRange.Fill.Visible = True
'透明度
t.ShapeRange.Fill.Transparency = 0
'塗りつぶし色
t.ShapeRange.Fill.ForeColor.RGB = RGB(255, 210, 1)
Exit For
End If
Next
End Sub
Dim t As Object
Dim s As String
For Each t In Sheets("Sheet3").Rectangles
'シェイプの名前
s = t.Name
If s = "Rectangle 1" Then
'表示
t.Visible = True
'位置
t.ShapeRange.Left = 132
t.ShapeRange.Top = 135
t.ShapeRange.Width = 49.5
t.ShapeRange.Height = 88.5
'角度
t.ShapeRange.Rotation = 0
'線 太さ
t.ShapeRange.Line.Weight = 0.75
'点線のスタイル
t.ShapeRange.Line.DashStyle = msoLineSolid
'線種
t.ShapeRange.Line.Style = msoLineSingle '1本線
'透明度
t.ShapeRange.Line.Transparency = 0 '0.0 (不透明) ~ 1.0 (透明)
'線の表示
t.ShapeRange.Line.Visible = True
'線色
t.ShapeRange.Line.ForeColor.RGB = RGB(255, 0, 0)
'塗りつぶし
t.ShapeRange.Fill.Visible = True
'透明度
t.ShapeRange.Fill.Transparency = 0
'塗りつぶし色
t.ShapeRange.Fill.ForeColor.RGB = RGB(255, 210, 1)
Exit For
End If
Next
End Sub
0 件のコメント:
コメントを投稿