Hi,
Below is the code for color selection.
[highlight #204A87]Private Sub Green_Click()
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 70, 206, _
172, 91).Select
With Selection.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.RGB = vbGreen
.BackColor.RGB =...
Hi SkipVought, Mintjulep
I had assigned another macro to insert the shapes with fixed color (vbRed, vbGreen, etc)
Then I'm stuck to get the number of shapes count.
What I need is, lets say I have 3 green shapes, 2 red shapes, 2 yellow shapes, I want the result to be show as
Cell (1,1): 3 (for...
Hi,
I try with both code but it seems to be not much different.
Selection.ShapeRange(1).TextFrame.Characters.Text = Round(Width, 1) * Round(Height, 1) & "m2"
Area: 42.84
Selection.ShapeRange(1).TextFrame.Characters.Text = Round(Width * Height, 2) & "m2"
Area: 42.88
Calculator: 43.08
hi,
How could I count the shapes with same color?
Dim shp As Shape
Dim vbYellow As Long
Dim vbGrey As Long
Dim vbRed As Long
Dim vbGreen As Long
If ActiveSheet.Shapes.ForeColor.RGB = vbYellow Then
Sheet1.Cells(2, 1) = ActiveSheet.Shapes.Count
End If
Hi Strongm,
Yes, I got
Width: 668.5715; Height: 144.3213
Width: 9.28571510314941; Height: 2.00446200370789
While Excel Shape format gave me
Width: 9.33; Height: 2
Based on my observation, the area of shape get from macro seems to be 0.4% different from what I got from excel shape format (own...
Hi,
I had convert the shape area to inches by dividing the width and height by 72.
but the data shown is inaccurate.
For example,
I had the rectangle shape with Width = 10.95", Height = 8.87"
Thru calculator I got the area as 97.1265
But macro gave me 96.7
Sub ShowArea()
Dim Width As Double...
Hi Andrzejek, SkipVought,
Thanks for the suggestion.
How bout the Auto Change of data if I change the shape?
Besides,
I'm using Round function for the area calculation but the decimal point seems to be having bugs.
If I had my coding for >0 of decimal point, the data shows will be 13 decimal...
Hi Strongm,
Thanks.
1). If I wish to have more than one data (width, height, area) show in the shape insert, how could I make it?
I tried with "+" but error prompted.
If separated to different coding, only one data will be shown.
2). What if I need the data to be shown automatically when I...
Hi macropod,
Thanks.
Perhaps you could help me further in below problem.
The code I have is to show the area of the shape I insert.
Now, all the shapes in the Excel Sheet will be shown the area once I hit the macro.
How if I only wan the shape which is active?
I tried with below code but it...
Dear all,
I wish to get the area of shapes to be shown whenever I insert new shape to excel.
Here is my coding.
currently I'm using divide to convert the point to inches, is there code to convert from point to inch?
Sub ShowArea()
For x = 1 To 50...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.