Not Like has no effect while looping an Array

0 votes

I am looping the array using the code below, however, the final condition, And Not...like, has no impact at all.

For i = 2 To UBound(arr)
    If arr(i, 2) Like "*Helideck*" Or _
       arr(i, 5) Like "*-HD-*" And _
       Not arr(i, 16) Like "*Fire*" Then arrH(i, 1) = "True"
Apr 10, 2023 in Others by narikkadan
• 63,420 points
217 views

1 answer to this question.

0 votes
you can add parentheses instead... mixing an Or with the And can be tricky, but using the parentheses properly can accomplish what you want as well. Here's a rough example: https://stackoverflow.com/questions/45704996/if-condition-with-and-combine-multiple-or-in-vba-excel
answered Apr 10, 2023 by Kithuzzz
• 38,010 points

Related Questions In Others

0 votes
1 answer

Excel MATCH function is not working on an array but works once directed to the matched value

According to the definition here: support.microsoft.com/en-us/office/… if you do ...READ MORE

answered Nov 17, 2022 in Others by narikkadan
• 63,420 points
656 views
0 votes
1 answer

Excel - Conditional Formatting not working because cell has an existing formula

Go to Conditional Formatting -> Rules to ...READ MORE

answered Dec 10, 2022 in Others by narikkadan
• 63,420 points
3,781 views
0 votes
1 answer

VBA: Do While Loop does not want to looping

Try this: currentRow = 11 Do While originalSheet.Cells(currentRow, 1).Value ...READ MORE

answered Mar 18, 2023 in Others by narikkadan
• 63,420 points
359 views
0 votes
1 answer

VBA - Build an Array by Looping Through Another Array with Specific Criteria

Please attempt the next option. It is ...READ MORE

answered Mar 23, 2023 in Others by narikkadan
• 63,420 points
352 views
0 votes
1 answer

Copy the respective values from another workbook depend on specific conditions

Try this: Sub Get_Respective_Values_Of_Last_Closing_Date() Dim wb1 ...READ MORE

answered Feb 6, 2023 in Others by narikkadan
• 63,420 points
347 views
0 votes
1 answer

VBA How do I replace the range with an array in SUMIF

You can't, in my opinion. When you ...READ MORE

answered Feb 7, 2023 in Others by narikkadan
• 63,420 points
497 views
0 votes
1 answer

Excel VBA compare values on multiple rows and execute additional code

I would use a Dictionary & Collection ...READ MORE

answered Feb 7, 2023 in Others by narikkadan
• 63,420 points
1,358 views
0 votes
1 answer

How to concatenate elements of a single-dimensional array using VBA?

Using Microsoft 365's UNIQUE and SORT in VBA ' This is a ...READ MORE

answered Feb 16, 2023 in Others by narikkadan
• 63,420 points
353 views
0 votes
1 answer

How to make an error flagging array in VBA and translate all array elements as a string message?

In my opinion, using an array in ...READ MORE

answered Mar 17, 2023 in Others by Kithuzzz
• 38,010 points
334 views
0 votes
1 answer

VBA - Build a Two-Column Array By Looping Through one Array with a Specific Criteria and Selecting From Another Array

As already mentioned as comment: Loop over ...READ MORE

answered Mar 24, 2023 in Others by Kithuzzz
• 38,010 points
265 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP