title: How to Concatenate variable name in a vba loop?
body: <p>I am trying to compare items in 2 arrays. If an item is present in the first array but not the second array, then I want to display its value. But I am struggling with the way to do this - my current attempt is below:</p>
  
  <pre><code>Dim l1     As Long
  Dim l2     As Long
  Dim Size1  As Long
  Dim Size2  As Long
  
  ' array1= listbox1 contents
  'array2 =listbox2 contents
  
  Size1 = UBound(array1)
  Size2 = UBound(array2)
  Dim bln As Boolean
  
  For l1 = 1 To Size1
     bln = False
     For l2 = 1 To Size2
         If array1(l1) = array2(l2) Then
            bln = True
         End If
     Next l2
     If bln = False Then
     Me.Label_nonmatchitems.Caption = "Do not have a match for item(s) " &amp; l1    
  
    Next l1
  
  End sub
  </code></pre>
  
  <p>If the 3 items in array1 does not match in array2, then my label is displaying 3 times, like this:</p>
  
  <pre><code> Do not have a match for item(s) value1
   Do not have a match for item(s) value8
   Do not have a match for item(s) value10
  </code></pre>
  
  <p>Instead I was looking for an output like this:</p>
  
  <pre><code>      Do not have a match for item(s) value1,value8,value10
  </code></pre>
  
  <p>There is something wrong with the logic in my loop - can you help me find and fix the error?</p>