View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Case sensitivity

It's in a worksheet module.

The "option compare text" will work in that kind of module, too.

JohnL wrote:

Thanks Dave. I was confused with (Target.Value) but your line was very
explanatory. My Worksheet Sub works like a charm now. Couldn't use your
second suggestion because this isn't in a module.
Thanks Rick and Dave for your time. I always learn things at this site.
JohnL

"Dave Peterson" wrote:

Notice Rick's suggestion included ucase().

Select Case UCase(Target.Value)

So you could use:

Select Case ucase(Range("D6").Value)

Another alternative if you don't care about any case comparisons...

Add this line to the top of the module:

Option Compare Text



JohnL wrote:

Rick, what it looks looks like is this:

Select Case Range("D6").Value

Case "HOUSE"
Range("A8â).Interior.ColorIndex = 6
Range("A8").Font.ColorIndex = 2

"Rick Rothstein" wrote:

It is always a good idea to show the code you are using for the problem area
you are asking your question about. My guess is for you to use the UCase
function on the argument to the Select Case statement and then test the
individual Case statements against upper case text. For example...

Select Case UCase(Target.Value)
Case "HOUSE"
....
Case "ROOM"
....
etc.
End Select

--
Rick (MVP - Excel)


--

Dave Peterson


--

Dave Peterson