ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Chart vanishes in paste operation (https://www.excelbanter.com/excel-programming/399452-chart-vanishes-paste-operation.html)

Fan924

Chart vanishes in paste operation
 
Can I use something else other than...
Cells(arr(x, 2), arr(x, 3)).PasteSpecial
There is data and a chart in the copy area and in the paste, and the
chart gets lost. ;(


joel

Chart vanishes in paste operation
 
Charts and Pictures sit on top of the worksheet and is not a part of the
worksheet. When you copy cells the don't include the items that are not part
of the workssheet. The pictures need to be copied seperately.

chart are located by there .left and .top location. Each cell also has a
..left and .top property.


Sub test()

startleft = Range("B4").Left
starttop = Range("B4").Top
endleft = Range("D7").Left
endtop = Range("D7").Top


For Each chrt In ActiveSheet.Shapes
If chrt.Type = msoChart Then
If chrt.Left = startleft And _
chrt.Top = starttop And _
chrt.Left <= endleft And _
chrt.Top <= endtop Then

MsgBox (chrt.Name & " was found to be inside range of cells")

End If
End If

Next chrt

End Sub

"Fan924" wrote:

Can I use something else other than...
Cells(arr(x, 2), arr(x, 3)).PasteSpecial
There is data and a chart in the copy area and in the paste, and the
chart gets lost. ;(




All times are GMT +1. The time now is 10:05 PM.

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