Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi everyone,
I am having a problem deleting a chart that I have placed on my 'Main worksheet. Upon using the..... ActiveWorkbook.Charts.Delete .....nothing happens because it doesn't detect my graph. Here's what happens in my app. I create the graph..... --------------------------------------------------------------------- Sub CreatChart() Charts.Add ActiveChart.ChartType = xlColumnClustered ActiveChart.SetSourceData Source:=Sheets("Main").Range ("A199:E201"), PlotBy _ :=xlRows ActiveChart.Location Whe=xlLocationAsObject, Name:="Main" End Sub' --------------------------------------------------------------------- Then I move it to a better location --------------------------------------------------------------------- Sub CoverRangeWithAChart() 'subroutine used to fill graph of the range I chose Dim RngToCover As Range Dim ChtOb As ChartObject Set RngToCover = ActiveSheet.Range("C13:L29") Set ChtOb = ActiveChart.Parent ChtOb.Height = RngToCover.Height ' resize ChtOb.Width = RngToCover.Width ' resize ChtOb.Top = RngToCover.Top ' reposition ChtOb.Left = RngToCover.Left ' reposition ActiveChart.PlotArea.Interior.ColorIndex = 42 End Sub -------------------------------------------------------------------- Now all that is left it to delete it however I am stuck on how to thi can be done. Can anyone please help? Much appreciate -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete a sheet and access charts | Excel Worksheet Functions | |||
Delete user-defined charts | Charts and Charting in Excel | |||
Delete ALL Charts in a WorkSheet (VB) | Charts and Charting in Excel | |||
Macro to delete charts | Excel Programming |