Can't get the like to compare

SeniorTom

Board Regular
Joined
Jun 5, 2017
Messages
96
I have 2 excel sheets one is a copy of the spreadsheet that google forms gives me. The other is one I want to update “Tracking 12 Mo MovAvg”. I would think the wild cards would qualify the “like”, but that is not the case. Any thoughts on what I’m doing wrong. Indents are not showing up in the post ... ???

Note: if I use match I get mostly better results, but that has its own problems.
Column “D” has a listing of courses separated by commas (see below).
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
From Debug.Print

2:16:26 PM
AGLER
0

CURRENT CP GOLF Tracking 12 Mo MovAvg updated 18 July 17.xlsm
*Sanford*
Sanford 8/3 Thursday @ 8:30, Falls Village Thursday 8/10 @ 8:00, The Preserve Monday 8/14 @ 8:00, Keith Hills Thursday 8/17 @ 8:30, Bryan Park Monday 8/21 @ 8:30, Lochmere Thursday 8/25 @ 8:00, Devils Ridge Monday 8/28 @ 9:00, Grandover East Thursday 8/31 @ 8:30

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
For Course = 0 To 10
' Activate the Tracking sheet, get the course name and column if blank ... bail
TrackingWB.Activate ' make sure you have the tracking sheet active
CourseName = ActiveCell.Offset(0, Course).Value
' Get the column letter, this is the column/course to updating status if needed
Debug.Print Time
Debug.Print Player
Debug.Print Err.Number
Debug.Print Err.Description
Debug.Print ActiveWorkbook.Name
Debug.Print "*" & CourseName & "*"
Debug.Print w1.Range("D" & MatchRowPlus)

ColTemp = Split(ActiveCell.Offset(0, Course).Columns.Address, "$") ' this is an array
CurrentColumn = ColTemp(1) ' gets column off the array
If CourseName = "" Then ' your at the end of the month
GoTo NextMember
Else
End If ' check the course against his response.
' this checks to see if the member requested this course, If not go to the next course
If Not UCase("*" & CourseName & "*") Like w1.Range("D" & MatchRowPlus) Then
Debug.Print Err.Number
Debug.Print Err.Description

GoTo NotThisCourse
Else
End If
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
You could try something like this
Code:
If InStr(w1.Range("D" & MatchRowPlus).Value, CourseName) = 0 Then
which would equate to the Not Like comparison.
 
Last edited:
Upvote 0
' this checks to see if the member requested this course, If not go to the next course
If Not UCase("*" & CourseName & "*") Like w1.Range("D" & MatchRowPlus) Then
Just so you know what is wrong with the above code line... all wildcards must appear in the text on the right side of the "Like" keyword. Without knowing what is in the cells, I would be guessing, but the way you have constructed your code line, I would guess it should be written this way instead...

If Not w1.Range("D" & MatchRowPlus) Like "*" & UCase(CourseName) & "*" Then
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top