Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Tze Chyi

    Count shapes with same color

    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 =...
  2. Tze Chyi

    Count shapes with same color

    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...
  3. Tze Chyi

    VB Excel_Area calculated in inches_Inaccurate

    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
  4. Tze Chyi

    Count shapes with same color

    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
  5. Tze Chyi

    VB Excel_Area calculated in inches_Inaccurate

    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...
  6. Tze Chyi

    VB Excel_Area calculated in inches_Inaccurate

    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...
  7. Tze Chyi

    Show Area of Shape insert

    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...
  8. Tze Chyi

    Show Area of Shape insert

    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...
  9. Tze Chyi

    Show Area of Shape insert

    Hi macropod, Thank you very much~~~
  10. Tze Chyi

    Show Area of Shape insert

    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...
  11. Tze Chyi

    Show Area of Shape insert

    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...

Part and Inventory Search

Back
Top