title: Nested If And Vlookup
body: <p>I have created a userform in VBA - which enters data into a table in the same workbook.</p>
  
  <p>Here is what I would like to happen:</p>
  
  <p>Textbox 5 will be disabled in my userform, but it should become enabled (and mandatory), if three conditions are met:</p>
  
  <p>1)  The value in Textbox 1 and Textbox 2 can be found in a row in my sourcetable (in the same worksheet)</p>
  
  <p>2)  The value in Textbox 3 is "0"</p>
  
  <p>3) The value in Textbox 4 is "0"</p>
  
  <p>I have a formula working which does the above in Excel but I'm not sure how to translate this into VBA.</p>
  
  <p>Here is the formula:</p>
  
  <p>=IF(AND(VLOOKUP(H5,C5:D12,2,FALSE)=I5,F5="0",G5="0"),"textbox5 becomes active and mandatory","textbox5 remains disabled"</p>
  
  <p>So to translate this formula into my UserForm:</p>
  
  <p>H5 would be the value in TextBox1,</p>
  
  <p>C5:C12 is my lookuprange -> columns D and E in my Source Table</p>
  
  <p>2 = Column E which holds the values for TextBox 2</p>
  
  <p>I5 = the current value in TextBox 2</p>
  
  <p>F5 = Value in Textbox 3 (needs to be 0)</p>
  
  <p>G5 = Value in Textbox 4 (needs to be 0)</p>
  
  <p>I hope that my description is clear, and I would really appreciate any help that I can get.</p>
  
  <p>Thanks,</p>