LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Test for presence of chart on active sheet

I've written the following code to create a chart on the active sheet.


'Select the range of data to chart (using the value from FindLastUsedRow)
Range(Cells(2, 1), Cells(intLastRow, 7)).Select

'Create the chart
With ActiveSheet.ChartObjects.Add(Left:=100, Width:=375, Top:=75,
Height:=255).Chart
.SetSourceData Source:=ActiveSheet.Range(Cells(2, 1), Cells(intLastRow,
7))
.ChartType = xlColumnClustered
.Axes(xlValue).MajorUnit = 1
End With


Two questions....

1) How can I check for the presence of a chart on the active sheet? The idea
is that the user clicks the button to initially create and then update the
chart, and I figured deleting and redrawing it would be the way to do this. I
need to be able to check if the chart on that sheet has already been created
and, if so, delete it.

2) Can someone explain to me the units of measurement that decide
whereabouts in the sheet the chart is placed? I got the (Left:=100,
Width:=375, Top:=75, Height:=255) above from the macro recorder, which is all
well and good but I don't understand exactly how it works.

Any suggestions greatly appreciated :)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I test a range of cells for the presence of a border? PFB Excel Worksheet Functions 7 November 10th 08 05:19 AM
Copy sheet and make new sheet active belvy123 Excel Discussion (Misc queries) 5 April 24th 08 03:33 PM
Active Cell Copy And Paste Sheet to Sheet A.R.J Allan Jefferys New Users to Excel 4 May 4th 06 02:04 AM
Need to test for file presence Grant Excel Programming 3 October 26th 04 08:57 PM
Test if Active Cell is in a named range Simon Shaw[_5_] Excel Programming 1 September 28th 04 12:11 AM


All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"