Selecting shapes and images in specific range, grouping then pasting in a new worksheet retaining group status.

trl123

New Member
Joined
Sep 28, 2017
Messages
6
Hi,

I am trying to create a form that people can edit. Users will use various shapes and images in a range to create a diagram and I want to save it to a table in another worksheet. The code below almost does what I want except it pastes the group of shapes as a picture. I would like to be able to retain the group status so it can be modified in the future.

'COPY AND PASTE INFORMATION TO FS- FORGE DATA Worksheet
'COPY AND PASTE DIAGRAM

'Select images and shapes from diagram box.
Dim shp As Shape
Dim r As Range
Set r = Range("C60:AS79")
For Each shp In ActiveSheet.Shapes
If Not Intersect(Range(shp.TopLeftCell, shp.BottomRightCell), r) Is Nothing Then _
shp.Select Replace:=False
Next shp

'Create group of images and shapes from diagram box to create diagram and reselect.
Selection.Group.Select

'Name diagram.
gName1 = Range("AI2").Value
gName2 = Range("V2").Value
NewGroup = gName1 & "-" & gName2
Selection.Name = NewGroup

'Copy diagram
Selection.Copy

'Ungroup selection on INPUT worksheet
Selection.Ungroup

'Paste diagram
Sheets("FS- Forge Data").Activate
lastRow = ActiveSheet.ListObjects("Table1").Range.Rows.Count - 1
ActiveSheet.ListObjects("Table1").DataBodyRange(lastRow, 172).Select
Selection.PasteSpecial

Thanks in advance,
trl123
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try replacing...

Code:
Selection.PasteSpecial

with

Code:
ActiveSheet.Paste

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top