Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Copy Chart and Insert in new Sheet as picture over the same location

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TFriis - 22 Jan 2008 15:04 GMT
As topic says: I would like som VBA code, that runs through all charts
in activesheet and copy pastes them to a new sheet as pictures and
placed above the same cells...

Can any of you out there help me :)
Jon Peltier - 22 Jan 2008 16:27 GMT
Sub ChartsToPictures()
 Dim chob As ChartObject
 Dim pict As Shape
 Dim shSource As Worksheet
 Dim shTarget As Worksheet

 Set shSource = ActiveSheet
 Set shTarget = ActiveWorkbook.Worksheets.Add(Before:=shSource)

 For Each chob In shSource.ChartObjects
   chob.Chart.CopyPicture xlScreen, xlPicture, xlScreen
   shTarget.Paste
   Set pict = shTarget.Shapes(shTarget.Shapes.Count)
   pict.Left = chob.Left
   pict.Top = chob.Top
 Next
End Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______

> As topic says: I would like som VBA code, that runs through all charts
> in activesheet and copy pastes them to a new sheet as pictures and
> placed above the same cells...
>
> Can any of you out there help me :)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.