title: Selecting a range if column and rows are variables
body: <p>This was my previous post <a href="https://stackoverflow.com/questions/7172222/insert-countif-formula-when-you-have-variable-holding-the-value">Insert COUNTIF formula when you have variable holding the value</a>.</p>
  
  <p>Below was the Solution.</p>
  
  <pre><code>Range("Q" &amp; minRow + 1).Formula = "=COUNTIF(P$" &amp; minRow &amp; ":P" &amp; minRow &amp; ",P" &amp; minRow + 1 &amp; ")=0"
  </code></pre>
  
  <p>I have a new Question. What if the column is a variable?</p>
  
  <p>What is the syntax if both are Variables (column and row are unknown and their values stored in a variable) and what is the syntax if column is variable and row is a number?</p>
  
  <p>I have tried these ways</p>
  
  <pre><code>"=COUNTIF( &amp; Columnz $1: &amp; Columnz &amp;2 ,&amp; Columnz &amp;2000)=0"
  </code></pre>
  
  <p>and these way </p>
  
  <pre><code>"=COUNTIF( "&amp; Columnz" $1: " &amp; Columnz"2,&amp; Columnz &amp;2000)=0"
  </code></pre>