title: Compress multiple OR-conditions in VBA code
body: <p>I use the following code to allow users to write a value into <strong>Cell A1</strong>.</p>
  
  <pre><code>Sub TestUsername()
  If Environ("Username") = "firstname1.lastname1" Or Environ("Username") = "firstname2.lastname2" _
  Or Environ("Username") = "firstname3.lastname3" Or Environ("Username") = "firstname4.lastname4" Then
  Sheet1.Range("A1").Value = 1
  Else
  Sheet1.Range("A2").Value = 2
  End If
  End Sub
  </code></pre>
  
  <p>As you can see I list each user who is allowed to enter a value into <strong>Cell A1</strong> with an <code>OR-condition</code> in my VBA code. All this works fine.</p>
  
  <hr>
  
  <p>Now, I was wondering if there is an easier way to do this. Something like this:</p>
  
  <pre><code>Sub TestUsername()
  If List of or-conditions: {"firstname1.lastname1", "firstname2.lastname2", _
  "firstname3.lastname3", "firstname4.lastname4"} = True Then
  Sheet1.Range("A1").Value = 1
  Else
  Sheet1.Range("A2").Value = 2
  End If
  End Sub
  </code></pre>
  
  <p>I just know in PHP you can compress multiple conditions like <a href="https://stackoverflow.com/questions/5593512/php-if-statement-with-multiple-conditions">here</a>. Therefore, I thought this might also be possible for VBA programming.</p>