PC Review


Reply
Thread Tools Rate Thread

how do I copy the picture from 1 figure to another? in VBA

 
 
mmaatman@hotmail.com
Guest
Posts: n/a
 
      4th Dec 2006
Hi,
I have a sheet with 2 figures
On one of them I have put a picture by choosing properties and clicking
a jpg at the picture property..
In VBA I want to duplicate the picture from this one to the other
figure

I have tried
worksheets(1).image2.picture = worksheets(1).image1.picture
But that doesnt do the job.

Any suggestions?

Thanks
Marcel (The Netherlands)

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      4th Dec 2006
One way:

Option Explicit
Sub testme()
Dim myFPicture As Picture
Dim myTPicture As Picture

With Worksheets("sheet1")
Set myFPicture = .Pictures("Picture 1")
End With

myFPicture.Copy
With Worksheets("sheet2")
.Paste
Set myTPicture = .Pictures(.Pictures.Count)
End With

'same position & name?
With myTPicture
.Top = myFPicture.Top
.Left = myFPicture.Left
.Width = myFPicture.Width
.Height = myFPicture.Height
.Name = myFPicture.Name
End With

End Sub




(E-Mail Removed) wrote:
>
> Hi,
> I have a sheet with 2 figures
> On one of them I have put a picture by choosing properties and clicking
> a jpg at the picture property..
> In VBA I want to duplicate the picture from this one to the other
> figure
>
> I have tried
> worksheets(1).image2.picture = worksheets(1).image1.picture
> But that doesnt do the job.
>
> Any suggestions?
>
> Thanks
> Marcel (The Netherlands)


--

Dave Peterson
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to figure out which right-click context menu is appearing whenclicking shape/picture dave.cuthill@computalog.com Microsoft Excel Programming 2 11th Jun 2009 06:51 PM
Copy automatically figure to another worksheet Canningsue Microsoft Excel Misc 1 28th Jul 2008 08:44 AM
RE: How do I copy a word figure and save it as a file? =?Utf-8?B?cm9nc29ubA==?= Microsoft Word New Users 0 12th Sep 2005 09:29 PM
Re: How do I copy a word figure and save it as a file? Doug Robbins Microsoft Word New Users 0 3rd Sep 2004 01:21 AM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Microsoft Excel Programming 1 15th Apr 2004 08:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:39 AM.