Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the cell color in excel whenever the cell's text is changed

Status
Not open for further replies.

Jooky68

Programmer
Jul 10, 2002
231
0
0
US
I am trying to change the color of a particular cell whenever the user changes the cells text on a spreadsheet. Does anyone have any idea if there is some sort of change() function for cells in excel or something along those lines?
Any ideas would be appreciated, thanks
 
You need the change event of the worksheet objectb - in project explrer double0click the appropriate worksheet and enter code like this:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Const YELLOW As Long = 6

With Target.Interior
.ColorIndex = YELLOW
.Pattern = xlSolid
End With
End Sub
 
Thanks a lot guys. I appreciate it. Also do you know of a website that has a lot of the even procedures for excel worksheets? I'm having trouble finding them and my VBA doesnt list the even procedures for excel like it does vb objects (im not sure if anyones does) thanks again for your help i appreciate it.
 
Hi Jooky
First place to start is the FAQ section for this forum - Skip has one
"What are Object Events and how do I find them?"

I was in the process of creating a book that uses events to do a couple of other things - really basic stuff. If you would like a copy (of the unfinished book) post your email address and I'll send it.

Having said that have a look at this link
and if you down load the file (eventseq) that is available from
you will get every event procedure demonstrated in order (which my book is trying to avoid doing!) This includes "application events" which I'd never even heard of until yesterday!

Good Luck

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
yeah loomah that would be great. My email address is jooky68@yahoo.com. And thanks again for the post I appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top