ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Evaluating if a Shape is a line or a shape (https://www.excelbanter.com/excel-programming/388418-evaluating-if-shape-line-shape.html)

Sanjay[_2_]

Evaluating if a Shape is a line or a shape
 
Hi,

Is it possible to find out if a selected shape is just a line or a shape
(i.e. has a line color and fill color)

Thanks!




Vergel Adriano

Evaluating if a Shape is a line or a shape
 
Sanjay,

I think you can check the Type property of the shape. If it's msoLine, then
it's a line.

Sub test()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
If shp.Type = msoLine Then
'this is a line
Debug.Print shp.Name & " is a line."
End If
Next shp
End Sub

--
Hope that helps.

Vergel Adriano


"Sanjay" wrote:

Hi,

Is it possible to find out if a selected shape is just a line or a shape
(i.e. has a line color and fill color)

Thanks!





Sanjay[_2_]

Evaluating if a Shape is a line or a shape
 
Thanks Vergel !



"Vergel Adriano" wrote in message
...
Sanjay,

I think you can check the Type property of the shape. If it's msoLine,
then
it's a line.

Sub test()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
If shp.Type = msoLine Then
'this is a line
Debug.Print shp.Name & " is a line."
End If
Next shp
End Sub

--
Hope that helps.

Vergel Adriano


"Sanjay" wrote:

Hi,

Is it possible to find out if a selected shape is just a line or a shape
(i.e. has a line color and fill color)

Thanks!









All times are GMT +1. The time now is 11:18 PM.

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