1

I have the following IF statement

If .Cells(r, "L").Value Like "Milestone*" Then If UBound(Split(.Cells(r, "L"), ",")) > 0 Then i = i + 1 ReDim v(1 To i) v(i) = pasteRowIndex End If 

I need to also include that this keyword is non case sensitive, but I am getting run time errors when I try.

Is there a quick solution?

1
  • If all of your comparisons in the module will be case insensitive, you can place Option Compare Text prior to the Sub ... statement. Commented Dec 1, 2017 at 1:32

1 Answer 1

1

The fastest solution - put both values in LCase (or UCase):

If LCase(.Cells(r, "L").Value) Like LCase("Milestone*") Then 

Or just one in LCase, and the other one written normally.

Sub TestMe() Debug.Print LCase("Milestonea") Like "milestone*" Debug.Print LCase("Milestonea") Like "Milestone*" End Sub 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.