ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Shape Size in Cell (https://www.excelbanter.com/excel-programming/285313-shape-size-cell.html)

mike

Shape Size in Cell
 
Hi. I have a macro that creates a red rectangle in a
cell. The rectangle actually hides the cell borders and
I do not wish it to do so. I'd like to make the
rectangle "slightly" smaller than the cell dimensions.
Can anyone tell me how to accomplish this? The code
follows:

If .Value ucl Then
Set mySquare = .Parent.Shapes.AddShape
(Type:=msoShapeRectangle, _
Top:=.Top, Left:=.Left, Width:=.Width,
Height:=.Height)
mySquare.Fill.Visible = msoFalse
mySquare.Line.Weight = 1.5
mySquare.Line.ForeColor.SchemeColor = 10
End If


mike

Shape Size in Cell
 
I believe I have answered my own question ... if I use
mycell.Width -2 and mycell.Height - 2, in the arguments
for the rectangle, I get a slightly smaller box.

Thanks,
Mike.

-----Original Message-----
Hi. I have a macro that creates a red rectangle in a
cell. The rectangle actually hides the cell borders and
I do not wish it to do so. I'd like to make the
rectangle "slightly" smaller than the cell dimensions.
Can anyone tell me how to accomplish this? The code
follows:

If .Value ucl Then
Set mySquare = .Parent.Shapes.AddShape
(Type:=msoShapeRectangle, _
Top:=.Top, Left:=.Left, Width:=.Width,
Height:=.Height)
mySquare.Fill.Visible = msoFalse
mySquare.Line.Weight = 1.5
mySquare.Line.ForeColor.SchemeColor = 10
End If

.



All times are GMT +1. The time now is 02:13 PM.

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