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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Case Insensitive 1

Status
Not open for further replies.

Bass71

MIS
Jun 21, 2001
79
0
0
I'm looking to disregard case in the following code... I've tried UCase LCase, Option Explicit. Is there a simple way to "disable" this feature?

Dim rng As Range, r As Range, iCol As Integer, i As String, j As Integer
Set rng = Range([B2], [B2].End(xlDown))

i = InputBox("Type Text or Number to be Searched")
j = 0
For Each r In rng
For iCol = 2 To 11
With Cells(r.Row, iCol)
If .Value = i And j = 0 Then
 
What about this ?
Option Compare Text

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
When you say you tried Ucase, how did you use it?

The following should work:

i = InputBox("Type Text or Number to be Searched")
j = 0
For Each r In rng
For iCol = 2 To 11
With Cells(r.Row, iCol)
If ucase$(.Value) = ucase$(i) And j = 0 Then


Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top