LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default how to change cell colour by simply clicking on it

OK, I'll try that- I just noticed that I was deleting the colours from
the other cells as well as the ones on the graph.

OK- I tried it and it worked!!!! My first macro!

Regarding my name-
Yeah- it's very French-Canadian! I guess it's a name that grows on ya
after a while... :)

Thanks again, Bob! You're awesome!!
Jovette


Bob Phillips wrote:
Just create a simple macro

Sub ClearCells()
Dim cell As Range

For each cell in
Range("D10:D20,E10:E20,F10:F20,G10:G20,H10:H20,I10 :I20")
cell.Interior.Colorindex = xlColorindexNone
Next cell

End Sub

maybe add a button to the worksheet from the forms toolbar, and assign that
macro to the button.

BTW, that is an unusual name, is it French-Canadian?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"lovebunny" wrote in message
oups.com...
IT WORKED!!!
Thanks SO very much, Bob! I could have never done this without your
help!!!! I really appreciate the time you've given me.

One last question-
How can I reset the graph and empty the coloured cells quickly so that
another student can use the graph?

Jovette

Bob Phillips wrote:
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




 
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
insert date Larry Excel Worksheet Functions 28 July 15th 06 02:41 AM
change a cell background colour to my own RGB colour requirements Stephen Doughty Excel Discussion (Misc queries) 4 June 16th 06 01:08 PM
alternating cell colour mohd21uk via OfficeKB.com New Users to Excel 2 May 12th 06 12:17 PM
Conditional Format as a MACRO Gunjani Excel Worksheet Functions 3 March 29th 06 05:22 PM
How to change cell colour, X no days from inserted date in Excel? Bayvon Excel Worksheet Functions 0 October 14th 05 05:17 AM


All times are GMT +1. The time now is 05:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"