title: How can I iterate over an array and populate some cells with 1 if the array contains the value, and 0 if not ,in VBA or Excel?
body: <p>I'm receiving from Wix an array with the courses selected by an user via a form.</p>
  <p>Example of an array receive from Wix where an user selected 2 courses. This array is placed in a cell.</p>
  <pre><code>[&quot;VBA&quot;,&quot;Django&quot;]
  </code></pre>
  <p>This above array is place inside a cell in my excel file from where I red the cell and populate a VBA array with the courses:</p>
  <pre><code>Dim data() As Variant
      Dim arrStr As String
      Dim dataItems As Long
      Dim i As Long
      Dim IndividualCourses(1 To 9) As String
  
      arrStr = Range(&quot;T3&quot;)
      arrStr = Replace(Replace(arrStr, &quot;[&quot;, &quot;{&quot;), &quot;]&quot;, &quot;}&quot;)
      data = Application.Evaluate(arrStr)
      dataItems = Application.CountA(data)
      For i = 1 To dataItems
          IndividualCourses(i) = data(i)
      Next i
  </code></pre>
  <p>But the user can select between 1 and 10 courses. The array for all courses:</p>
  <p>[&quot;JS&quot;,&quot;Python&quot;,&quot;VBA&quot;,&quot;Java&quot;,&quot;Spring&quot;,&quot;C++&quot;,&quot;C#&quot;,&quot;.NET&quot;,&quot;Django&quot;,&quot;CSS&quot;]</p>
  <p>I want, based on the array received from Wix, to put 1 in the cell of the courses present in the array and 0 in the other courses.</p>
  <p>For example, this courses selected  [&quot;VBA&quot;,&quot;Django&quot;], it should put 1 in the VBA cell and 1 in the Django cell, and 0 in the remianing courses cells, because I want to see what courses an user has selected.</p>
  <p>Any ideea for this complicated problem ?!?</p>