Link to home
Start Free TrialLog in
Avatar of Andreas Hermle
Andreas HermleFlag for Germany

asked on

Copy selected graphic to other worksheets using VBA

Dear Experts:

I would like to copy the currently selected graphic (named 'My_Graphic') to all other worksheets (except a worksheet named Base_Sheet) of the active workbook  using VBA

The graphic is to be positioned on the respective worksheets at the following position:

From Left: 3 cm
From Top: 4,2 cm.

After copying and positioning the graphics are to be ungrouped.

Help is much appreciated. Thank you very much in advanced.

Regards, Andreas
Avatar of Fernando Bravo Diaz
Fernando Bravo Diaz

You can get the shapes in a worksheet with this:

Dim sp As Shape
Worksheet1.Shapes("Imagen 2").Copy

Open in new window


then to copy it to the next worksheets:

For Each ws In Worksheets
        If ws.name <> "Base_Sheet" Then
            'Your sheet range to paste the shape
            Worksheet1.Paste ws.Range("A1")
        End If
Next ws

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I was able to do this with INDIRECT and using named ranges to refer to the graphics, an example workbook is in this question:

It works great but can bog down a larger workbook, which is why I am looking for an alternative.
Avatar of Andreas Hermle

ASKER

Dear all,

thank you very much for your great and swift support.

As a matter of fact Neeraj's code is exactly what I was looking for and everything works like a charm with Neeraj's code.

Thank you
What is the matter with this website. I cannot close the question, there are not buttons to do so. Strange :-(
I am still not able to award points ... no buttons exist to do so. Must be some strange malfunctioning of the website.
nice job, thank you very much for it
You're welcome Andreas! Glad it worked as desired.