Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default VBA code to automatically colour cells depending on text?

Hi, - with the skill of Don Guillet (Excel MVP - thank you!!) I have nearly
finished a €˜to-do list to help organise my life as an infant school teacher.
see attached link:

http://www.box.net/shared/ejzn141dux

The worksheet works like this:

Enter desired text in cell €˜c3, h3 or m3 and then use the drop down button
in €˜b3, g3 or l3 to determine the position where the text is to be placed in
the below list. If there is text already in that position, all the text below
is moved down one cell. If you delete text from a cell then the text in the
cells below moves up one. This part of it works fine.

The VBA code currently being been used is;

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range) 'SAS
Application.EnableEvents = False
Application.ScreenUpdating = False
If Not Intersect(Target, Range("B3,G3,L3")) Is Nothing Then

With Cells(Target + 5, Target.Column + 1)
If Len(Application.Trim(.Value)) < 1 Then
.Value = Target.Offset(, 1).Value
Else
Target.Offset(, 1).Copy
.Insert Shift:=xlDown
End If
End With
End If

Range("C6:C105,H6:G105,M6:L105").SpecialCells(xlCe llTypeBlanks).Delete
Shift:=xlUp
Application.CutCopyMode = False
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub

I would like to know how to adapt the above code so that if I type a phrase
containing the word €˜Trago into cells c3, h3 or m3 the selected destination
cell would be highlighted light red?

I have tried conditional formatting but it does not retain after more than
one go €“ so I think the solution is adapting the above code?

Yours hopefully,
Matt.

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
VBA Code to Automatically move text into above cells? mj_bowen Excel Discussion (Misc queries) 3 January 2nd 10 11:30 AM
get cell to automatically change colour depending on text in adja. wilko Excel Discussion (Misc queries) 2 November 10th 09 01:55 PM
Insert text depending on font colour Tricia Excel Discussion (Misc queries) 2 May 15th 09 08:15 PM
Changing cell colour depending on another cells value... Web master Excel Discussion (Misc queries) 3 January 10th 06 12:30 PM
How to code so cells or text automatically change color based on . lisamariehewson Excel Worksheet Functions 2 February 25th 05 10:10 PM


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