Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Feb 2007
    Location
    Vienna, Wien, Austria
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Shape properties (Excel 2003)

    hello all,

    i wonder if it is possible to supply a shape with its properties (height and width) via cells.
    in my attachment you can see, that it is possible to conditionally fill any shapes in a spreadsheet via cells, so you can make some diagrams for maps.
    does anyone of you know how to adjust my code to change the properties as well??
    thanks in advance, stefan
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Shape properties (Excel 2003)

    If you want to use the values in columns J and K for the height and width of the shapes, you can add these lines somewhere within the outer loop:

    curShape.Height = konfigSheet.Cells(shapeZeile, 10)
    curShape.Width = konfigSheet.Cells(shapeZeile, 11)

  3. #3
    2 Star Lounger
    Join Date
    Feb 2007
    Location
    Vienna, Wien, Austria
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shape properties (Excel 2003)

    that is awesome,
    thank You, Hans

    stefan

  4. #4
    2 Star Lounger
    Join Date
    Feb 2007
    Location
    Vienna, Wien, Austria
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shape properties (Excel 2003)

    sorry for asking for an add: how do i define shape height or width in centimeters instead of points?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Shape properties (Excel 2003)

    The Excel VBA function Application.CentimetersToPoints converts centimeters to points, so if you enter the height in centimeters in konfigSheet.Cells(shapeZeile, 10), you can use

    curShape.Height = Application.CentimetersToPoints(konfigSheet.Cells( shapeZeile, 10))

  6. #6
    2 Star Lounger
    Join Date
    Feb 2007
    Location
    Vienna, Wien, Austria
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shape properties (Excel 2003)

    thank You again,
    stefan

Posting Permissions

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