Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wrote a simple script in VB. But it failed to run in field calculator. I can't figure out what is wrong with it. Below is a screenshot.

enter image description here

share|improve this question
I don't really know vbscript but that pipe character at after a="N" looks like it could be the culprit. – Fezter Oct 31 '13 at 23:09
Thanks, Fezter! I tried, that was not the problem. – 12B01 Nov 1 '13 at 13:45
Is the field you're updating a text field? – Fezter Nov 2 '13 at 3:27
Yes, it is. The data type of "Match", "HHZIP", and "ZCTA5CE10" are all text – 12B01 Nov 4 '13 at 14:42
Use Python! :):D – user7172 Feb 22 at 8:14

Remove the Dim a as String line and it will work. Calculate Field is using VBScript, and in VBScript all variables are of type Variant.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.