title: Excel VBA Dropdown list, default value
body: <p>Using following code to create dropdown if A Col has a value.
  How do I set <strong>No</strong> as default value?</p>
  
  <pre><code>  Dim myList As String, r As Range
  
    myList = "Yes,No"
  
    If w1.Range("A" &amp; Rows.Count).End(xlUp).Address &lt;&gt; "$A$1" Then
      For Each r In w1.Range("A2", w1.Range("A" &amp; Rows.Count).End(xlUp))
          If r.Value &lt;&gt; vbNullString Then
              With r.Offset(, 2).Validation
              .Delete
              .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Formula1:=myList
              End With
              If r.Offset(, 2).Value = "" Then r.Offset(, 2).Value = "No"
              If r.Offset(, 2).Value = "" Then Split myList, ","
              End If
        Next r
    End If
  </code></pre>