• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Data linked SmartArt/Shapes using VBA

sn152

Member
I am trying to create a smart art using vba. The smart art should be linked to the data in sheet 1. I have attached the example worksheet with the data and the smartart. I have converted the smartart to shapes, in order to link the data. But I am not sure how to do this using vba.Kindly help me. TIA..
 

Attachments

  • Sample2.xlsx
    133.7 KB · Views: 20
I am trying to create a smart art using vba. The smart art should be linked to the data in sheet 1. I have attached the example worksheet with the data and the smartart. I have converted the smartart to shapes, in order to link the data. But I am not sure how to do this using vba.Kindly help me. TIA..
Hi,

You can use ".select" to select the shape in VBA and then use something like:
Code:
Sub Test()

    Selection.Formula = "=$D$18"
 
End Sub

Please see attached
 

Attachments

  • Sample2.xlsm
    142.3 KB · Views: 19
Thanks for the reply PCosta.

I know this. But is there a way where I can have avba code to create the shapes automatically and add the data.. (like the one in my attachment)?
 
Thanks for the reply PCosta.

I know this. But is there a way where I can have avba code to create the shapes automatically and add the data.. (like the one in my attachment)?
Yes, you can use ".AddShape"
Code:
ActiveSheet.Shapes.AddShape(msoShapeRoundedRectangle, 449.25, 400.5, 93.75, _
        158.25).Select
    Selection.Formula = "=$C$18"

I would suggest trying macro recording with this one... and then modify the macro if needed
 
Back
Top