I am creating a results page for my macro. The results will vary day to day as data is processed.
I used the method below to find the next empty cell.
QUESTION: how do I modify this to find the next 2 empty cells and then place new data in the third?
Example: Column A1 has data to A10 thus A11 is the first empty cell. I want the macro then to place the next set of results starting in cell A13.
<code class="vb keyword">Sub</code> <code class="vb plain">Macro2()</code>
<code class="vb spaces"> </code><code class="vb keyword">On</code> <code class="vb keyword">Error</code> <code class="vb keyword">Resume</code> <code class="vb keyword">Next</code>
<code class="vb spaces"> </code><code class="vb keyword">Dim</code> <code class="vb plain">xCell </code><code class="vb keyword">As</code> <code class="vb plain">Range</code>
<code class="vb spaces"> </code><code class="vb keyword">For</code> <code class="vb keyword">Each</code> <code class="vb plain">xCell </code><code class="vb keyword">In</code> <code class="vb plain">ActiveSheet.Columns(1).Cells</code>
<code class="vb spaces"> </code><code class="vb keyword">If</code> <code class="vb plain">Len(xCell) = 0 </code><code class="vb keyword">Then</code>
<code class="vb spaces"> </code><code class="vb plain">xCell.</code><code class="vb keyword">Select</code>
<code class="vb spaces"> </code><code class="vb keyword">Exit</code> <code class="vb keyword">For</code>
<code class="vb spaces"> </code><code class="vb keyword">End</code> <code class="vb keyword">If</code>
<code class="vb spaces"> </code><code class="vb keyword">Next</code>
<code class="vb keyword">End</code> <code class="vb keyword">Sub
Thank you for any help provided on this.</code>
I used the method below to find the next empty cell.
QUESTION: how do I modify this to find the next 2 empty cells and then place new data in the third?
Example: Column A1 has data to A10 thus A11 is the first empty cell. I want the macro then to place the next set of results starting in cell A13.
<code class="vb keyword">Sub</code> <code class="vb plain">Macro2()</code>
<code class="vb spaces"> </code><code class="vb keyword">On</code> <code class="vb keyword">Error</code> <code class="vb keyword">Resume</code> <code class="vb keyword">Next</code>
<code class="vb spaces"> </code><code class="vb keyword">Dim</code> <code class="vb plain">xCell </code><code class="vb keyword">As</code> <code class="vb plain">Range</code>
<code class="vb spaces"> </code><code class="vb keyword">For</code> <code class="vb keyword">Each</code> <code class="vb plain">xCell </code><code class="vb keyword">In</code> <code class="vb plain">ActiveSheet.Columns(1).Cells</code>
<code class="vb spaces"> </code><code class="vb keyword">If</code> <code class="vb plain">Len(xCell) = 0 </code><code class="vb keyword">Then</code>
<code class="vb spaces"> </code><code class="vb plain">xCell.</code><code class="vb keyword">Select</code>
<code class="vb spaces"> </code><code class="vb keyword">Exit</code> <code class="vb keyword">For</code>
<code class="vb spaces"> </code><code class="vb keyword">End</code> <code class="vb keyword">If</code>
<code class="vb spaces"> </code><code class="vb keyword">Next</code>
<code class="vb keyword">End</code> <code class="vb keyword">Sub
Thank you for any help provided on this.</code>