title: How can I create a dependent list using data validation in VBA?
body: <p>I'm creating a drop down list using the code above:</p>
  
  <pre><code>            For Each Value In wb1.Range("B6:B" &amp; LastRow)
              Lista = Lista &amp; "," &amp; Value
              Next Value
  
              Lista2 = Lista &amp; "," &amp; ",A,B,C,D,E,F,G"
  
              With Cells(30,39).Validation
              .Delete
              .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
              xlBetween, Formula1:=Lista2
              End With
  </code></pre>
  
  <p>But now I'm trying to create a dependent list using VBA. I want to put conditions for my list, being dependent on the value of the left column.</p>
  
  <p>If left column value is "AL" or "SD" I want to have Lista &amp; "," &amp; ",A,B" list selection, if "PC" I want to have "C,D,E" and if it's "LV" I want it to have "F,G"</p>
  
  <p>Could someone please help me with this?</p>