<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421149#M14189</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You shouldn't declare the variables as a type. Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim MyStr&lt;/P&gt;&lt;P&gt;Dim strLen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Sep 2014 16:39:40 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2014-09-22T16:39:40Z</dc:date>
    <item>
      <title>Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421146#M14186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I'm a newbie to VBA Script, so any of the below script could be wrong. I'm trying to use Field Calculator to replace any "_10" at the end of a filename (i.e. an entry in a field, in an attribute table) with "_11". Could anyone help me please? Many thanks in advance! sdrew1&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Pre-logic VBA Script Code&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Dim MyStr as string&lt;/P&gt;&lt;P&gt;Dim strLen as integer&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;strLen = Len([FILENAME])&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If Right([FILENAME],3) = "_10" Then&lt;/P&gt;&lt;P&gt;MyStr = Left([FILENAME], strLen-3)) &amp;amp; "_11"&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;MyStr = [FILENAME]&lt;/P&gt;&lt;P&gt;End if&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Filename =&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;MyStr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 15:32:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421146#M14186</guid>
      <dc:creator>StephenDrew1</dc:creator>
      <dc:date>2014-09-22T15:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421147#M14187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you'd have to give me more information, &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt; have you tried cut and paste?! Repeat the string?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 15:55:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421147#M14187</guid>
      <dc:creator>TMgapinski</dc:creator>
      <dc:date>2014-09-22T15:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421148#M14188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are a lot of them in the database. E.g. the FileName field is populated with record entries such as "New_Town_Planning_Project_10" and I want to make all the thousends of records entries be "New_Town_Planning_Project_11".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 16:02:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421148#M14188</guid>
      <dc:creator>StephenDrew1</dc:creator>
      <dc:date>2014-09-22T16:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421149#M14189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You shouldn't declare the variables as a type. Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim MyStr&lt;/P&gt;&lt;P&gt;Dim strLen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 16:39:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421149#M14189</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2014-09-22T16:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421150#M14190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ken, for the help. It sadly still doesn't work (I get an error message that sayd 'Error Running VBA code: User interrupt.'). If you or anyone has any other ideas I would be a very grateful recipient! Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 07:45:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421150#M14190</guid>
      <dc:creator>StephenDrew1</dc:creator>
      <dc:date>2014-09-23T07:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421151#M14191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about a Python one-liner?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filename = !Filename![:-3] + !Filename![-3:].replace("_10", "_11")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 14:07:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421151#M14191</guid>
      <dc:creator>PeteCrosier</dc:creator>
      <dc:date>2014-09-23T14:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421152#M14192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pete, thanks for the help but it's Arc 9.3 so only works in VBA - unless I'm missing something - I'm not used to Python (either). Thanks for trying to help - any clue about VBA would be very grateful!?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 14:13:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421152#M14192</guid>
      <dc:creator>StephenDrew1</dc:creator>
      <dc:date>2014-09-23T14:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421153#M14193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think 9.3 should support Python if you run the Field Calculator geoprocessing tool, otherwise for VBA this should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim length&lt;/P&gt;&lt;P&gt;Dim result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length = Len([Filename])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If length &amp;gt; 2 Then&lt;/P&gt;&lt;P&gt;&amp;nbsp; result = Left([Filename], length - 3) &amp;amp; Replace(Right([Filename], 3), "_10", "_11")&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;&amp;nbsp; result = [Filename]&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filename =&lt;/P&gt;&lt;P&gt;result&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 14:33:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421153#M14193</guid>
      <dc:creator>PeteCrosier</dc:creator>
      <dc:date>2014-09-23T14:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421154#M14194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's great Pete, thanks very much! That works brilliantly. And I think I'm learning - I can actually work out why you've written it as you have. The only bit I don't know about is why you might have written 'if the length is greater than 2'? Is that in case there are default blank fields? (If you don't want to answer this that's ok - I'm just learning and can't find links on the net to teach me about it...). Cheers Pete. Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 08:26:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421154#M14194</guid>
      <dc:creator>StephenDrew1</dc:creator>
      <dc:date>2014-09-24T08:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421155#M14195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A simple find and replace couldn't be used here? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 10:58:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421155#M14195</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2014-09-24T10:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421156#M14196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe, Thanks for reply. I did consider that but I didn't want it to get rid of the '_100' or '_210' so I thought it might be easier the alternative route. Sorry, you weren't to know that there might be '210' etc as an alternative. Cheers again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 11:48:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421156#M14196</guid>
      <dc:creator>StephenDrew1</dc:creator>
      <dc:date>2014-09-24T11:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421157#M14197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, in case there's a string that's blank or too short for the Left and Right to work properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Joe said, you can probably use the Replace function better if it supports the 'normal':&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Replace(string, find, replace[, start[, count[, compare]]])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.. VBA format in field calculator.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 12:18:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421157#M14197</guid>
      <dc:creator>PeteCrosier</dc:creator>
      <dc:date>2014-09-24T12:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421158#M14198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah great, thanks very much! Good to see the Replace function written out, thats informative!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 12:23:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421158#M14198</guid>
      <dc:creator>StephenDrew1</dc:creator>
      <dc:date>2014-09-24T12:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421159#M14199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My mistake; just re-read the original post and I was thinking attribute value and you are renaming files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 01:33:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421159#M14199</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2014-09-25T01:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator VBA ArcGIS 9.3 - how to replace the last three characters of a string?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421160#M14200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem - thanks for posting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 09:05:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-vba-arcgis-9-3-how-to-replace-the/m-p/421160#M14200</guid>
      <dc:creator>StephenDrew1</dc:creator>
      <dc:date>2014-09-25T09:05:53Z</dc:date>
    </item>
  </channel>
</rss>

