Clearing a chart title with less lines of code

D

Don Wiss

Right now to clear a chart title I'm running the below code. I would think
that I could clear it in a single line without having to activate the chart
object. But I haven't figured out how.

Dim SheetName As String, Here As String
SheetName = ActiveSheet.name
Here = ActiveCell.Address

Sheets("Graphs").Select
ActiveSheet.ChartObjects(1).Activate
ActiveChart.ChartArea.Select
ActiveChart.HasTitle = False

Range("A1").Select

Sheets(SheetName).Select
Range(Here).Select

Don <donwiss at panix.com>.
 
R

Rob Bovey

Hi Don,

Sheets("Graphs").ChartObjects(1).Chart.HasTitle = False

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top