LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Alternative to Conditional Formatting

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
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
How can I convert conditional formatting into explicit formatting? Patrick Harris Excel Discussion (Misc queries) 0 April 9th 09 12:00 AM
Conditional formatting--different formatting depending on cell con Tammy S. Excel Discussion (Misc queries) 3 March 30th 09 08:11 PM
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM


All times are GMT +1. The time now is 11:15 AM.

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"