ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CopyAndPaste Object w/namechange (https://www.excelbanter.com/excel-programming/292334-copyandpaste-object-w-namechange.html)

CLR

CopyAndPaste Object w/namechange
 
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







Bob Phillips[_6_]

CopyAndPaste Object w/namechange
 
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)

"CLR" wrote in message
...
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









CLR

CopyAndPaste Object w/namechange
 
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



"Bob Phillips" wrote in message
...
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)

"CLR" wrote in message
...
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












All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com