Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Simtug,
Like Gary, I could not replicate your error. Which specific line of code is highlighted when the error occurs? --- Regards, Norman "simtug" wrote in message ... Hi, Gary, my aim is to change the color of cells depending on the text typed in by the end user. The conditional formatting option is not feasible. The VBA code I have used goes as follows: Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("U4")) Is Nothing Then If UCase(Target.Value) = "0" Then Target.Interior.ColorIndex = 43 Else If UCase(Target.Value) = "A1" Then Target.Interior.ColorIndex = 17 Else If UCase(Target.Value) = "A2" Then Target.Interior.ColorIndex = 23 Else If UCase(Target.Value) = "B1" Then Target.Interior.ColorIndex = 44 Else If UCase(Target.Value) = "B2" Then Target.Interior.ColorIndex = 46 Else If UCase(Target.Value) = "C1" Then Target.Interior.ColorIndex = 39 Else If UCase(Target.Value) = "C2" Then Target.Interior.ColorIndex = 47 Else End If End If End If End If End If End If End If End If End Sub When I place the cursor in the U4 cell and I change the previous inserted text with a different one no problem, but when I want to delete the previous typed text by pressing del DEL key (which is something the end user is routinely doing) I get a runtime error (13) alerting about a non-corrisponding type error. Any help how to avoid the error window to pop up? Thank you very much for any help! Simone -- simtug ------------------------------------------------------------------------ simtug's Profile: http://www.excelforum.com/member.php...o&userid=28255 View this thread: http://www.excelforum.com/showthread...hreadid=477742 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I convert conditional formatting into explicit formatting? | Excel Discussion (Misc queries) | |||
Conditional formatting--different formatting depending on cell con | Excel Discussion (Misc queries) | |||
Formatting cells in a column with conditional formatting? | Excel Discussion (Misc queries) | |||
Protect Cell Formatting including Conditional Formatting | Excel Discussion (Misc queries) | |||
Conditional Formatting that will display conditional data | Excel Worksheet Functions |