I have been trying in vain to do the following:
Textbox A: Has hundreds of Youtube Video IDs
Textbox B: Has less Youtube Video IDs
I want to click a button and then have a new text box populated with all the Video IDs in textbox A that are NOT in Textbox B... sounds simple...
So far ive made two arrays and a nested for next loop, it's not working as i want though which is frustrating.
I'm willing to pay for your trouble if someone can get this working, and give me commented code so i understand what's going on.
My code so far:
It occasionally throws a 1, even though they arent the same, and debugging it i see it's because sometimes it reads a blank space from "TextBox B"Code:Dim splitIDs, splitMerged ** *Dim temp, temp2 As String ** *Dim foundMatch As Boolean ** *Dim retval As Integer ** * ** *splitIDs = Split(TextIDs.Text, vbCrLf) ' *This is Textbox A ** *splitMerged = Split(TextMerged.Text, vbCrLf) ' *This is Textbox B ** * ** *For x = 0 To UBound(splitIDs) ** * ** * * *temp = splitIDs(x) ** * ** * * * * *For y = 0 To UBound(splitMerged) ** * * * * * ** * * * * * * *temp2 = splitMerged(y) ** * * * * * * * ** * * * * * * *Log ("temp *is: " & temp) ** * * * * * * *Log ("temp2 is: " & temp2) ** * * * * * * * ** * * * * * * *retval = InStr(1, temp, temp2) ' Returns 1 if match, 0 if not ** * * * * * * * ** * * * * * * *Log ("Result for compare was: " & retval) ** * * * * * * * ** * * * * * * *Select Case retval ** * * * * * * * * *Case 0: ** * * * * * * * * * * *foundMatch = False ** * * * * * * * * * * *Log ("I think " & temp & " & " & temp2 & " are different") ** * * * * * * * * * * *TextResult.Text = TextResult.Text & vbCrLf & temp ** * * * * * * * * *Case 1: ** * * * * * * * * * * *Log ("I think " & temp & " & " & temp2 & " are same") ** * * * * * * * * * * *foundMatch = True: Exit For ** * * * * * * *End Select * * * * ** * * * * *Next y * ** *Next x
Plus it prints LOADS of each one, when it shouldnt...
It's a long shot asking for help but i'm pulling my hair out
Thanks


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks