Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
porl99
 
Posts: n/a
Default How can I create a chart when double clicking a cell?

Hi - thanks for your help I am very much a novice in Excel but am
trying to learn. I've tried to recreate the worksheet below and what I
want is that when you double click on the person's name (Katie or Jeff)
then Excel prepares a graph showing the scores that that child
achieved. I have bought a book and am trying to teach myself, but
everytime I think I've got the right idea my formulae come back with
errors. If you be kind enough to offer me some assistance - it would
be very gratefully received! Many thanks in advance, Paul

English Maths Science
Katie Autumn 7 7 5 6 7 8
Spring 7 6 6 7 5 5
Summer 8 6 4 6 7 7

Jeff Autumn 6 6 5 6 6 7
Spring 7 7 5 5 6 6
Summer 7 6 6 6 6 6

  #2   Report Post  
Nige
 
Posts: n/a
Default

Hi Paul - You can record a macro to create the chart and assign a key stroke,
like CTRL + T to run the macro (rather than double-clicking the child's
name). If you record a macro which creates the chart in a new sheet then the
macro will create a new chart each time it runs, so you might want to delete
the chart/sheet before running it. If you make a chart to appear in the
current sheet rather than a new sheet I think you'll get an error when you
re-run the macro, so when you record the macro make sure you create the chart
in a new sheet .

To run the macro by double clicking the name isn't so straight-forward - the
only way I know of doing this is to add code to the worksheet's
BeforeDoubleClick event in visual basic to run the macro.

Let's say Katie's name is in cell A32, then if you record a macro to create
the chart in a new sheet, say you've named it "Macro1", you can add this code
to the worksheet's BeforeDoubleClick event in VB so it looks like this:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

If Target.Address = "$A$32" Then
Application.Run "Macro1"
End If

End Sub

This will run the macro creating the chart when you double click cell A32.
You could also add code to this to delete the last chart made so you don't
end up with dozens of charts.

If you're new to this just start by recording the macro to create the chart
you want, assign a letter as a shortcut key using Macro Options, and see how
you get on.

Nige



"porl99" wrote:

Hi - thanks for your help I am very much a novice in Excel but am
trying to learn. I've tried to recreate the worksheet below and what I
want is that when you double click on the person's name (Katie or Jeff)
then Excel prepares a graph showing the scores that that child
achieved. I have bought a book and am trying to teach myself, but
everytime I think I've got the right idea my formulae come back with
errors. If you be kind enough to offer me some assistance - it would
be very gratefully received! Many thanks in advance, Paul

English Maths Science
Katie Autumn 7 7 5 6 7 8
Spring 7 6 6 7 5 5
Summer 8 6 4 6 7 7

Jeff Autumn 6 6 5 6 6 7
Spring 7 7 5 5 6 6
Summer 7 6 6 6 6 6


Reply
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 do I create a "backwards" chart Sarah Charts and Charting in Excel 2 March 31st 05 05:08 AM
How do I create a pointer chart, like a speedometer? Ricardo Kozlowski Charts and Charting in Excel 2 March 31st 05 03:23 AM
Create a custom chart, two stacked bars/month w/ two axes? Oscar Charts and Charting in Excel 1 March 21st 05 11:07 PM
Problem with xlusrgal.xls file Alfred S C Lee Charts and Charting in Excel 2 December 29th 04 05:54 PM
create space in line chart between points, linked to pivot table Mike -Z- Charts and Charting in Excel 1 December 7th 04 09:39 PM


All times are GMT +1. The time now is 09:21 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"