Hi,
I'm trying to figure out how to auto-populate details for certain cells based on certain conditions:
I did find a code which auto-populates Date in Column A when information is entered in Column B:
I can't figure out how to replicate it though to meet the conditions listed above
Help please and thank you
I'm trying to figure out how to auto-populate details for certain cells based on certain conditions:
- Columns A, I, L, and Z should auto-populate Date when Column B has information keyed in
- Column F should auto-populate "Walk In" and Column G should auto-populate "Endorsed to" when Column E has information keyed in
- Column K should auto-populate "Go" when Column J has information keyed in
- Column N and AA should auto-populate "No Go" when Column M has information keyed in
I did find a code which auto-populates Date in Column A when information is entered in Column B:
Code:
<code class="vb keyword">Private</code> <code class="vb keyword">Sub</code> <code class="vb plain">Worksheet_Change(</code><code class="vb keyword">ByVal</code> <code class="vb plain">Target </code><code class="vb keyword">As</code> <code class="vb plain">Excel.Range)</code>
<code class="vb comments">'Updated by Extendoffice 2017/10/12</code>
<code class="vb spaces"> </code><code class="vb keyword">Dim</code> <code class="vb plain">xRg </code><code class="vb keyword">As</code> <code class="vb plain">Range, xCell </code><code class="vb keyword">As</code> <code class="vb plain">Range</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">If</code> <code class="vb plain">(Target.Count = 1) </code><code class="vb keyword">Then</code>
<code class="vb spaces"> </code><code class="vb keyword">If</code> <code class="vb plain">(</code><code class="vb keyword">Not</code> <code class="vb plain">Application.Intersect(Target, </code><code class="vb keyword">Me</code><code class="vb plain">.Range(</code><code class="vb string">"B:B"</code><code class="vb plain">)) </code><code class="vb keyword">Is</code> <code class="vb keyword">Nothing</code><code class="vb plain">) </code><code class="vb keyword">Then</code> <code class="vb plain">_</code>
<code class="vb spaces"> </code><code class="vb plain">Target.Offset(0, -1) = </code><code class="vb keyword">Date</code>
<code class="vb spaces"> </code><code class="vb plain">Application.EnableEvents = </code><code class="vb keyword">False</code>
<code class="vb spaces"> </code><code class="vb keyword">Set</code> <code class="vb plain">xRg = Application.Intersect(Target.Dependents, </code><code class="vb keyword">Me</code><code class="vb plain">.Range(</code><code class="vb string">"B:B"</code><code class="vb plain">))</code>
<code class="vb spaces"> </code><code class="vb keyword">If</code> <code class="vb plain">(</code><code class="vb keyword">Not</code> <code class="vb plain">xRg </code><code class="vb keyword">Is</code> <code class="vb keyword">Nothing</code><code class="vb plain">) </code><code class="vb keyword">Then</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">xRg</code>
<code class="vb spaces"> </code><code class="vb plain">xCell.Offset(0, -1) = </code><code class="vb keyword">Date</code>
<code class="vb spaces"> </code><code class="vb keyword">Next</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 plain">Application.EnableEvents = </code><code class="vb keyword">True</code>
<code class="vb spaces"> </code><code class="vb keyword">End</code> <code class="vb keyword">If</code>
<code class="vb keyword">End</code> <code class="vb keyword">Sub</code>
I can't figure out how to replicate it though to meet the conditions listed above
Help please and thank you
Last edited: