title: Output/Print variable, in code, in if statement
body: <p>I am trying to achieve the following:
  The user is shown an excel spread sheet with a list of assumption which they can change.</p>
  
  <pre><code>Title       |     Value        |
  Input01     |       10         |  =
  Input02     |       2          |  &gt;=
  Input03     |       800        |  &gt;=
  Input04     |       4          |  &gt;=
  Input05     |       2          |  &lt;=
  </code></pre>
  
  <p>There is an <code>If .. Then</code> Statement that pulls in data if the assumption are met. However if an assumption is blanc, it should not be included in the <code>If .. Then</code> Statement.</p>
  
  <pre><code>If x = Input01Value And y &gt;= Input02Value _
  And z &gt;= Input03Value And a &gt;= Input04Value _
  And b &lt;= Input05Value Then
  </code></pre>
  
  <p>User ommits Input03</p>
  
  <pre><code>If x = Input01Value And y &gt;= Input02Value _
  And a &gt;= Input04Value And b &lt;= Input05Value Then
  </code></pre>
  
  <p>Now I could check to see if each value exist, and then follow it  by another <code>If</code> statement with the appropriate variables. But this seems a bit redundant.</p>
  
  <p>I was wondering if something like the following is possible:</p>
  
  <pre><code>Input 01 = ""
  If Input01Value != "" Then Input01 = "x = " &amp; Input01Value
  'Then use join or something similar to join all of them ..
  </code></pre>
  
  <p>And Then use this <code>Input01</code> directly in the <code>If .. Then</code> statement. This way when a variable is empty the <code>And ..</code> are not included and the <code>If</code> statement will not fail.<br>
  Eg. (I know this doesn't work, just illustrating the scenario)</p>
  
  <pre><code>VBA: If Input01 Then
  Result while compiling: If x = Input01Value Then
  </code></pre>
  
  <p>Please Note, I know I could do something like the following:<br>
  <code>If Boolean And Variable2 &gt; 4 Then</code> and then have <code>Boolean</code> and <code>Variable2</code> populate with a value in the cell, however the issue with this is that if the user, for example, decides to omit the <code>Variable2</code> (which is reasonable) it will fail. eg. <code>If (Boolean = True) And &gt; 4 Then</code>.</p>
  
  <p>Hope my question is clear, thanks for the help.</p>