在VBA中更改实线的颜色

时间:2017-05-20 09:40:03

标签: vba colors line rgb

我只想在这一行下添加一行,以使行RGB(0,255,0)

Sub Button1_Click()

设置My_line =工作表(" Zadatak1")。Shapes.AddLine(10,10,250,250)

End Sub

1 个答案:

答案 0 :(得分:0)

试试这个:

Sub Button1_Click()
 Set My_Line = Worksheets("Zadatak1")

 With My_Line.Shapes.AddConnector(msoConnectorStraight, 10, 10, 250, 250)
  .Line.ForeColor.RGB = RGB(0,255,0)
 End With

End Sub