title: VBA IF Value is null end script else continue
body: <p>New to VBA so I do apologize for any stupidity here.  I am working on custom script for software we have, it seems like everywhere has excel scripting.  </p>
  
  <p>Working code</p>
  
  <pre><code>IF StrComp(XXXX.GetField("Col_1"), RIGHT(xxxx.GetField("Col_2"), 4)) &lt;&gt; 0 
  Then xxxx.SetField "Col_1" , RIGHT(xxxx.GetField("Col_2"), 4)
  End If
  </code></pre>
  
  <p>What is happening is the script is running fine but if there is a Blank value in Col_1 and a Null Value in Col_2 it is updating Col_1 with ****.  I would like that if Col_2 is nothing, blank or NULL to do nothing at all end script however if there is a value there to test if Col_1 = last 4 of Col_2 if those are not equal then run the update.  Hopefully this make sense.  This was my attempt but crashed and burned.</p>
  
  <pre><code>If RIGHT(xxxx.GetField("Col_2"), 4) Is Nothing 
  THEN Exit
  IF StrComp(XXXX.GetField("Col_1"), RIGHT(xxxx.GetField("Col_2"), 4)) &lt;&gt; 0
  Then xxxx.SetField "Col_1" , RIGHT(xxxx.GetField("Col_2"), 4)
  End If
  </code></pre>