Any Excel Bunnies out there? :D

Soldato
Joined
11 Dec 2003
Posts
21,634
Location
Sol
Heyas all, just working with a Teacher at work on an excel file that has some stuff in that I'm not 100% sure on, its to do with child behaviour levels,ie if you go to a certain kid's row, type in PE as they misbehaved in PE it clours the box yellow (no text) and gives a PE flyover when you hover over it, thats all good and well, he has programmed the macro so that all functions correctly.

The problem is, he wants when you fill in a box, it will also create/update a graph on a certain sheet (Create if not present, update if one is present) (one extra sheet per student in the file) I realy have no clue where to start on this, not sure how it'd work or if it even would, just to get some data on the bar graph such as 1 x pe 2 x re etc..just to try and get something started, as I'm realy not sure on a good place to start.

Any ideas would be welcomed!

Thanks!

-T
 
Pseudo code...

The trigger event is the update in the box
Check if a sheet for the pupil exists
If it doesn't, create it
Check if a graph exists on the sheet
It is does, delete it
Create a chart using the data on the first sheet

You'll have to write it in VB, though you could start with a rough macro recording and edit that to suit. After that, just build it up bit by bit i.e. start with getting it to check for a sheet when you edit a given field, then check for a chart, etc. The tough bit will be creating the chart using the data from the sheet; the rest is fairly straightforward. Use the Visual Basic/Excel in built help to find out the functions you need, and if you Google for what you're trying to do, you can usually find enough help.

VB isn't the nicest language in the world to program in, but the functions are generally fairly usable so long as you can figure out which inputs you're dealing with.

My other tip would be to use the MsgBox function for testing as you go, so you can do things like check for a given sheet, and if it exists it'll pop up a message box telling you that the sheet exists, etc.
 
Back
Top Bottom