Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am taking a computer course and needed to create an activity using
Excel. I put together an activity where Kindergarten students graph M&M candies according to colour. What I would like to do is allow for cells to change colour when a child clicks on it with the mouse. (e.g. for each yellow M&M, the child is to click on cell in graph under the pic of the yellow M&M. These cells would in turn change to corresponding colour.) I would also need to know how to have cell return to original colour when clicked on twice- in case a mistake is made. I have an example of what I want to do- see he http://www.scs.sk.ca/cyber/elem/lear...s/rec_sht.html Thank you in advance for your help- I am really new at this and unfortunately can't figure this out on my own. Jovette |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You could try this
put some autoshapes in C3, E3 and G3 as an example and fill colour them yellow, red, and blue. Name them MMin3, MMin5, MMin7 and then add this code Private Sub Worksheet_SelectionChange(ByVal Target As Range) Const WS_RANGE As String = "C4:C20,E4:E20,G4:G20" On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target If .Interior.ColorIndex = xlColorIndexNone Then .Interior.ColorIndex = Me.Shapes("MMin" & ..Column).Fill.ForeColor.SchemeColor - 7 Else .Interior.ColorIndex = xlColorIndexNone End If End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. click a cell in columns C, E or G and see what happens. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "lovebunny" wrote in message oups.com... I am taking a computer course and needed to create an activity using Excel. I put together an activity where Kindergarten students graph M&M candies according to colour. What I would like to do is allow for cells to change colour when a child clicks on it with the mouse. (e.g. for each yellow M&M, the child is to click on cell in graph under the pic of the yellow M&M. These cells would in turn change to corresponding colour.) I would also need to know how to have cell return to original colour when clicked on twice- in case a mistake is made. I have an example of what I want to do- see he http://www.scs.sk.ca/cyber/elem/lear...s/rec_sht.html Thank you in advance for your help- I am really new at this and unfortunately can't figure this out on my own. Jovette |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Bob-
Thanks for your help with this. Unfortunately, I'm not really sure where to put this info. Is there a way that I can attach my doc so that you can see what I have put together so far and guide me from there? I am using Excell 2000. Thanks, Jovette |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Take a look at this file, and see what you can understand, post back with
any questions http://cjoint.com/?ikqUfLyAe0 -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "lovebunny" wrote in message ups.com... Hi Bob- Thanks for your help with this. Unfortunately, I'm not really sure where to put this info. Is there a way that I can attach my doc so that you can see what I have put together so far and guide me from there? I am using Excell 2000. Thanks, Jovette |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Okay, that helped!
I created autoshapes and I pasted them behind my candy images (I had previously found clipart of different coloured M&M candy and pasted them in each column). I gave them a corrsponding colour and named them MMin1, MMin2, MMin3, MMin4, MMin5 and MMin6 (I went to "insert", "name", then "define" to do this... Is this correct?) I figured out how to go in the code part. I pasted the formula you gave me but modified it according to where my autoshapes are. This is what I typed: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Const WS_RANGE As String = "D10:D20,E10:E20,F10:F20,G10:G20,H10:H20,I10:I 20," On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target If .Interior.ColorIndex = xlColorIndexNone Then .Interior.ColorIndex = Me.Shapes("MMin" & ..Column).Fill.ForeColor.SchemeColor - 7 Else .Interior.ColorIndex = xlColorIndexNone End If End With End If ws_exit: Application.EnableEvents = True End Sub Now, the cells that I click into change to white. When I click twice, they say white. What part of the above formula must I change to get the cells to be the right colours when I click on them once? My colours a D column - yellow, E- brown, F- blue, G-green, H-orange, I-red. Another question: Is there also a way that I can clear the graph once the students are done their activity so that they can start over again? Thanks again for your help!!! Jovette Bob Phillips wrote: Take a look at this file, and see what you can understand, post back with any questions http://cjoint.com/?ikqUfLyAe0 -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "lovebunny" wrote in message ups.com... Hi Bob- Thanks for your help with this. Unfortunately, I'm not really sure where to put this info. Is there a way that I can attach my doc so that you can see what I have put together so far and guide me from there? I am using Excell 2000. Thanks, Jovette |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The way to rename the shapes is to type the new name into the Names box, not
via the menu. They should also be named in line with the target columns, that is MMin4, MMin 5, etc.. not 1,2,3,... -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "lovebunny" wrote in message oups.com... Okay, that helped! I created autoshapes and I pasted them behind my candy images (I had previously found clipart of different coloured M&M candy and pasted them in each column). I gave them a corrsponding colour and named them MMin1, MMin2, MMin3, MMin4, MMin5 and MMin6 (I went to "insert", "name", then "define" to do this... Is this correct?) I figured out how to go in the code part. I pasted the formula you gave me but modified it according to where my autoshapes are. This is what I typed: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Const WS_RANGE As String = "D10:D20,E10:E20,F10:F20,G10:G20,H10:H20,I10:I 20," On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target If .Interior.ColorIndex = xlColorIndexNone Then .Interior.ColorIndex = Me.Shapes("MMin" & .Column).Fill.ForeColor.SchemeColor - 7 Else .Interior.ColorIndex = xlColorIndexNone End If End With End If ws_exit: Application.EnableEvents = True End Sub Now, the cells that I click into change to white. When I click twice, they say white. What part of the above formula must I change to get the cells to be the right colours when I click on them once? My colours a D column - yellow, E- brown, F- blue, G-green, H-orange, I-red. Another question: Is there also a way that I can clear the graph once the students are done their activity so that they can start over again? Thanks again for your help!!! Jovette Bob Phillips wrote: Take a look at this file, and see what you can understand, post back with any questions http://cjoint.com/?ikqUfLyAe0 -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "lovebunny" wrote in message ups.com... Hi Bob- Thanks for your help with this. Unfortunately, I'm not really sure where to put this info. Is there a way that I can attach my doc so that you can see what I have put together so far and guide me from there? I am using Excell 2000. Thanks, Jovette |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
insert date | Excel Worksheet Functions | |||
change a cell background colour to my own RGB colour requirements | Excel Discussion (Misc queries) | |||
alternating cell colour | New Users to Excel | |||
Conditional Format as a MACRO | Excel Worksheet Functions | |||
How to change cell colour, X no days from inserted date in Excel? | Excel Worksheet Functions |