Shapes With VBA - Format all lines on active sheet using VBA
Use: To change the color,style,etc of all lines (shapes) on active sheet
Sub format_all_lines_using_vba()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
If shp.Type = msoLine Then ' choose shape
shp.Line.Weight = 2 ' adjust width
shp.Line.ForeColor.RGB = RGB(255, 0, 18) ' choose color
shp.Line.DashStyle = msoLineDashDot ' choose dash style to apply
End If
Next
End Sub
»
- Ashish Koul's blog
- Login or register to post comments
- 5593 reads
Recent comments
5 years 34 weeks ago
6 years 20 weeks ago
6 years 32 weeks ago
6 years 35 weeks ago
6 years 36 weeks ago
6 years 42 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago