ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Make rectangle border solid (https://www.excelbanter.com/excel-programming/372123-make-rectangle-border-solid.html)

Zone

Make rectangle border solid
 
I have one shape in my worksheet ("Rectangle 1"). I somehow made the
line (border around the rectangle) have a pattern. I want to reset the
line to a solid color. I can select the shape first, but then using
record doesn't help because I can't find any button to set it back to a
solid color. TIA, and thanks to everyone for all the help in this
newsgroup. James


Dave Peterson

Make rectangle border solid
 
Rightclick on the rectangle and choose Format|autoshape.
Then choose the Color and lines tab to change what you want.

I modified my recorded macro to this:

Option Explicit
Sub testme()
Dim myShape As Shape

For Each myShape In ActiveSheet.Shapes
If myShape.Type = msoAutoShape Then
If myShape.AutoShapeType = msoShapeRectangle Then
With myShape
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.SchemeColor = 65
.Fill.Transparency = 0#
.Line.Weight = 4.5
.Line.DashStyle = msoLineRoundDot
.Line.Style = msoLineSingle
.Line.Transparency = 0#
.Line.Visible = msoTrue
.Line.ForeColor.SchemeColor = 10
.Line.BackColor.RGB = RGB(255, 255, 255)
End With
End If
End If
Next myShape
End Sub

But it did more than you asked.

Zone wrote:

I have one shape in my worksheet ("Rectangle 1"). I somehow made the
line (border around the rectangle) have a pattern. I want to reset the
line to a solid color. I can select the shape first, but then using
record doesn't help because I can't find any button to set it back to a
solid color. TIA, and thanks to everyone for all the help in this
newsgroup. James


--

Dave Peterson

Zone

Make rectangle border solid
 
Thanks, Dave. Where I was getting confused was I kept going to
Patterned Lines looking for a way to set it to solid. The way to get
rid of the pattern was just to select a standard color from the
Palette. James

Dave Peterson wrote:
Rightclick on the rectangle and choose Format|autoshape.
Then choose the Color and lines tab to change what you want.

I modified my recorded macro to this:

Option Explicit
Sub testme()
Dim myShape As Shape

For Each myShape In ActiveSheet.Shapes
If myShape.Type = msoAutoShape Then
If myShape.AutoShapeType = msoShapeRectangle Then
With myShape
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.SchemeColor = 65
.Fill.Transparency = 0#
.Line.Weight = 4.5
.Line.DashStyle = msoLineRoundDot
.Line.Style = msoLineSingle
.Line.Transparency = 0#
.Line.Visible = msoTrue
.Line.ForeColor.SchemeColor = 10
.Line.BackColor.RGB = RGB(255, 255, 255)
End With
End If
End If
Next myShape
End Sub

But it did more than you asked.

Zone wrote:

I have one shape in my worksheet ("Rectangle 1"). I somehow made the
line (border around the rectangle) have a pattern. I want to reset the
line to a solid color. I can select the shape first, but then using
record doesn't help because I can't find any button to set it back to a
solid color. TIA, and thanks to everyone for all the help in this
newsgroup. James


--

Dave Peterson




All times are GMT +1. The time now is 08:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com