locked
Insert/display a ShapeRange based on user input RRS feed

  • Question

  • Hello

    I have large set of autoshape groups in excel 2010 and I want to be able to display a few at a time based on user input. Is there a way create a lookup to a specific ShapeRange with an "if"..."then" loop? as in "If user input=x then display group1 at cell a1, next..." any guidence you might have would be appreciated. Thanks

    Monday, February 9, 2015 7:13 PM

Answers

  • Hi ahernen,

    >>Is there a way create a lookup to a specific ShapeRange with an "if"..."then" loop? as in "If user input=x then display group1 at cell a1, next..." any guidence you might have would be appreciated. <<

    Based on my understanding, we can use ShapeRange.Visible to control whether the shape is visible. And we can use left and top to set the position of shape.

    Here is a sample that make the first two shape to visible and set its left for your reference:

    if true then
     With myDocument.Shapes.Range(Array(1, 2))
     .Visible = True
     .Left = Range("A1").Left
     End With
    end if

    You can get more detail about ShapeRange from link below:

    ShapeRange Object

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, February 10, 2015 7:51 AM