title: Using variables in to use Validation in Excel VBA: use variable to define Operator
body: <p>I'm using a reference table to hold variables to define Date validations. I've used similar code to define List validations from a reference table w/o issues. It appears that I have an issue with assigning a value to OPERATOR using a table-driven value. Any assistance appreciated.</p>
  
  <pre><code>For Each c In dateFields
                fieldName = "entry_" &amp; c.Value
                validateOperator = "xl" &amp; dropDownSh.Cells(c.Row, c.Column + 1).Value 'list of operator values, e.g., "Between", etc.
                validateStart = dropDownSh.Cells(c.Row, c.Column + 2).Value
                validateStop = dropDownSh.Cells(c.Row, c.Column + 3).Value
                If validateStop = "" Then validateStop = validateStart
                MsgBox (fieldName &amp; ":" &amp; validateList)
  
                Range(fieldName).Select
                With Selection.Validation
                      .Delete
                      If validateOperator = "xlBetween" Then
                            .Add Type:=xlValidateDate, _
                            AlertStyle:=xlValidAlertStop, _
                            Operator:=validateOperator, _
                            Formula1:=validateStart, _
                            Formula2:=validateStop
                      Else
                            .Add Type:=xlValidateDate, _
                            AlertStyle:=xlValidAlertStop, _
                            Operator:=xlGreaterEqual, _
                            Formula1:=validateStart
                      End If
  
                      .IgnoreBlank = True
                      .InCellDropdown = True
                      .InputTitle = ""
                      .ErrorTitle = ""
                      .InputMessage = ""
                      .ErrorMessage = ""
                      .ShowInput = True
                      .ShowError = True
                End With
          Next c
  </code></pre>