CopyAndPaste Object w/namechange

  • Thread starter Thread starter CLR
  • Start date Start date
C

CLR

Hi All...........

Is it possible to copy and paste a Drawing Object, such as a Rectangle, or
whatever, and in doing the process, change the name of the Object at the
same time?............sort of a "paste-as".........

Vaya con Dios,
Chuck, CABGx3
 
Chuck,

Don't know if you consider this to be '... at the same time...'

Worksheets("Sheet1").Shapes("Oval 1").Copy
With Worksheets("Sheet2")
.PasteSpecial Format:="MS Office Drawing Object"
.Shapes(.Shapes.Count).Name = "Bob"
End With


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Thanks for the response Bob, it looks good, but I don't seem to be able to
get it to work...........
I pasted it in to a Module, and tried, but just couldn't get it to
run.......what did I do wrong?


Sub CopyObjectRename ()

Worksheets("Sheet1").Shapes("Oval 1").Copy
With Worksheets("Sheet2")
.PasteSpecial Format:="MS Office Drawing Object"
.Shapes(.Shapes.Count).Name = "Bob"
End With
End Sub


Vaya con Dios,
Chuck, CABGx3
 
Back
Top