+ Reply to Thread
Results 1 to 2 of 2

Measure shapes in excel

Hybrid View

Nirmall Measure shapes in excel 01-06-2016, 05:19 PM
mgs73 Re: Measure shapes in excel 01-06-2016, 08:28 PM
  1. #1
    Forum Contributor
    Join Date
    08-15-2015
    Location
    India
    MS-Off Ver
    Office 2016
    Posts
    227

    Measure shapes in excel

    Hi,

    i can create different shapes in excel using freeform in insert.

    Firstly is it possible to create the user defined shape as a shape which i can use without having to redraw it time and again.

    Secondly is it possible to resize the shape based on the value of cells, for example

    let us assume oval is a shape which i have created using freeform,then based on a list of data which gives the length and the width of the oval shape

    i want the shape to be made of that size.

    Is that possible???

  2. #2
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    423

    Re: Measure shapes in excel

    Have a look at this - it should get you started:
    Option Explicit
    
    Public Sub Test()
      Dim shp As Shape
      Dim Left As Long, Top As Long, Width As Long, Height As Long
      
      Left = Selection.Left
      Top = Selection.Top
      Width = 200
      Height = 100
      
      Set shp = ActiveSheet.Shapes.AddShape(msoShapeOval, Left, Top, Width, Height)
      GetShapeInfo
    End Sub
    
    Public Sub GetShapeInfo()
      Dim shp As Shape
      Dim r As Long
      
      r = 1
      For Each shp In ActiveSheet.Shapes
        Cells(r, 1).Value = shp.Name
        Cells(r, 2).Value = shp.AutoShapeType
        Cells(r, 3).Value = shp.Top
        Cells(r, 4).Value = shp.Left
        Cells(r, 5).Value = shp.Width
        Cells(r, 6).Value = shp.Height
      Next
    End Sub
    Last edited by mgs73; 01-06-2016 at 08:35 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 11-14-2015, 08:25 AM
  2. Excel Power pivot measure
    By eajustin15 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-12-2013, 05:16 PM
  3. [SOLVED] Unit of Measure Calculations Backward & Forwards_ Excel VBA Programming
    By AGCSC1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-24-2013, 10:03 AM
  4. [SOLVED] Excel 2003 ~ How to change the default units of measure?
    By Robin Blackwell in forum Excel General
    Replies: 4
    Last Post: 03-15-2010, 04:02 AM
  5. How To Move Shapes From Another Shapes? (floating shapes)
    By MarcLev in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2009, 04:04 PM
  6. [SOLVED] How do I measure area under a line chart drawn in Excel file?
    By kp in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-18-2005, 09:06 AM
  7. [SOLVED] How can i get more 3D shapes for Auto shapes in excel?
    By Ajey in forum Excel General
    Replies: 0
    Last Post: 03-03-2005, 06:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1