Workbook Tabs

  • Thread starter Thread starter Graham Parkinson
  • Start date Start date
G

Graham Parkinson

I have set up a template workbook that I use regularly to
produce standard analysis reports. I have all the chart
titles and table titles linked to a worksheet in the
workbook. I only need to change a few cells in this
worksheet to change the chart titles and tables
automatically. I would like to be able to link the
worksheet and chart tabs to these cells as well. I have
been able to sort of do this for the worksheets, but I'm
having problems setting the same up for the chart tabs.
Can anyone suggest how I can go about this.

Thanks
Graham
 
I'm not sure what you've tried, but something like this event macro
(where Chart1 is the codename for the chart sheet you want to change)
may work for you:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If Not Intersect(.Cells, Range("A1")) Is Nothing Then
On Error Resume Next
Me.Name = .Value & "_Sheet"
Chart1.Name = .Value & "_Chart"
On Error GoTo 0
End If
End With

End Sub
 
Thanks very much, works great.
-----Original Message-----
I'm not sure what you've tried, but something like this event macro
(where Chart1 is the codename for the chart sheet you want to change)
may work for you:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If Not Intersect(.Cells, Range("A1")) Is Nothing Then
On Error Resume Next
Me.Name = .Value & "_Sheet"
Chart1.Name = .Value & "_Chart"
On Error GoTo 0
End If
End With

End Sub


"Graham Parkinson"
.
 

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

Back
Top