<?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: TextString Conversion Method? in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151105#M49525</link>
    <description>Good questions. Thanks again. I learned alot.

Dan


"James Belshan" &lt;JLBELSHAN&gt; wrote in message
news:416314df$1_3@newsprd01...
&amp;gt; NP... I think I still like the old school way, though.  I'm not a big fan
of
&amp;gt; Variants -- if I'm not even sure what type of variable I'm passing to a
&amp;gt; function, how likely is it that I know it has a valid value?  An
example....
&amp;gt; I was curious what would happen if I sent it a string that was
semi-numeric,
&amp;gt; so I tried Format("5.45a") thinking I'd get an error or "5.45".  The
result
&amp;gt; was  "5:45:00 AM".  In hindsight, it makes sense, but how many other
&amp;gt; unexpected answers are there lurking out there?
&amp;gt;
&amp;gt; Just my opinion.....
&amp;gt;
&amp;gt; James
&amp;gt;
&amp;gt;&lt;/JLBELSHAN&gt;</description>
    <pubDate>Tue, 05 Oct 2004 23:59:41 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2004-10-05T23:59:41Z</dc:date>
    <item>
      <title>TextString Conversion Method?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151098#M49518</link>
      <description>Hello Everyone,
I wanted to ask what methods are better to use to carryout this function:

I want to convert a textstrings in the following.
EXAMPLES:
----------------------
FROM:   AB1204
TO: 12'-4"

FROM: AB0909
TO: 9'-9"

Basically, I have a 4 digit number representing feet and inches.  I think I
have figured a method out by "bullying" the textstring using IF, THEN, LEFT.
RIGHT, and MID functions.  IF/THEN for feet less than 10 feet, etc..

I was thinking there must be a better way to do this.

Any suggestions, code, example, etc. is grreatly appreciated.  Throught this
NewsGroup, I have learned much.

Thank you,
Dan</description>
      <pubDate>Tue, 05 Oct 2004 16:54:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151098#M49518</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-10-05T16:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: TextString Conversion Method?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151099#M49519</link>
      <description>You're in luck... you don't need to bully the textstring's, the VAL function
will take care of the values less than 10.... if your format is always
4-digit, padded with zeroes (and always integers), you could just use:

dim too as string, from as string
from="AB1204"
too = Format(Val(Mid(from, 3, 2))) &amp;amp; "'-" &amp;amp; Format(Val(Mid(from, 5, 2))) &amp;amp;
""""
msgbox too


HTH,
James


"Dan" &lt;DANDERSON&gt; wrote in message
news:4162d1e6_3@newsprd01...
&amp;gt; Hello Everyone,
&amp;gt; I wanted to ask what methods are better to use to carryout this function:
&amp;gt;
&amp;gt; I want to convert a textstrings in the following.
&amp;gt; EXAMPLES:
&amp;gt; ----------------------
&amp;gt; FROM:   AB1204
&amp;gt; TO: 12'-4"
&amp;gt;
&amp;gt; FROM: AB0909
&amp;gt; TO: 9'-9"
&amp;gt;
&amp;gt; Basically, I have a 4 digit number representing feet and inches.  I think
I
&amp;gt; have figured a method out by "bullying" the textstring using IF, THEN,
LEFT.
&amp;gt; RIGHT, and MID functions.  IF/THEN for feet less than 10 feet, etc..
&amp;gt;
&amp;gt; I was thinking there must be a better way to do this.
&amp;gt;
&amp;gt; Any suggestions, code, example, etc. is grreatly appreciated.  Throught
this
&amp;gt; NewsGroup, I have learned much.
&amp;gt;
&amp;gt; Thank you,
&amp;gt; Dan
&amp;gt;
&amp;gt;&lt;/DANDERSON&gt;</description>
      <pubDate>Tue, 05 Oct 2004 17:27:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151099#M49519</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-10-05T17:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: TextString Conversion Method?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151100#M49520</link>
      <description>AWESOME! I knew there must be a better way, and I learned about a new
function.
Thank you very much,
Dan

"James Belshan" &lt;JLBELSHAN&gt; wrote in message
news:4162d971$1_3@newsprd01...
&amp;gt; You're in luck... you don't need to bully the textstring's, the VAL
function
&amp;gt; will take care of the values less than 10.... if your format is always
&amp;gt; 4-digit, padded with zeroes (and always integers), you could just use:
&amp;gt;
&amp;gt; dim too as string, from as string
&amp;gt; from="AB1204"
&amp;gt; too = Format(Val(Mid(from, 3, 2))) &amp;amp; "'-" &amp;amp; Format(Val(Mid(from, 5, 2))) &amp;amp;
&amp;gt; """"
&amp;gt; msgbox too
&amp;gt;
&amp;gt;
&amp;gt; HTH,
&amp;gt; James
&amp;gt;
&amp;gt;
&amp;gt; "Dan" &lt;DANDERSON&gt; wrote in message
&amp;gt; news:4162d1e6_3@newsprd01...
&amp;gt; &amp;gt; Hello Everyone,
&amp;gt; &amp;gt; I wanted to ask what methods are better to use to carryout this
function:
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; I want to convert a textstrings in the following.
&amp;gt; &amp;gt; EXAMPLES:
&amp;gt; &amp;gt; ----------------------
&amp;gt; &amp;gt; FROM:   AB1204
&amp;gt; &amp;gt; TO: 12'-4"
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; FROM: AB0909
&amp;gt; &amp;gt; TO: 9'-9"
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Basically, I have a 4 digit number representing feet and inches.  I
think
&amp;gt; I
&amp;gt; &amp;gt; have figured a method out by "bullying" the textstring using IF, THEN,
&amp;gt; LEFT.
&amp;gt; &amp;gt; RIGHT, and MID functions.  IF/THEN for feet less than 10 feet, etc..
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; I was thinking there must be a better way to do this.
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Any suggestions, code, example, etc. is grreatly appreciated.  Throught
&amp;gt; this
&amp;gt; &amp;gt; NewsGroup, I have learned much.
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Thank you,
&amp;gt; &amp;gt; Dan
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt;
&amp;gt;&lt;/DANDERSON&gt;&lt;/JLBELSHAN&gt;</description>
      <pubDate>Tue, 05 Oct 2004 18:43:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151100#M49520</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-10-05T18:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: TextString Conversion Method?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151101#M49521</link>
      <description>Hi James,
Curious about the use of val function
I seem to get the same from
too = Format(Mid(from, 3, 2)) &amp;amp; "'-" &amp;amp; Format(Mid(from, 5, 2)) &amp;amp; """"
as from your line using val
I didn't try every possible input value though
It seems from the help description that it only eliminates alpha characters
which in this case according to the specs is taken care of by the format of
the input string
???
tia
Mark

"James Belshan" &lt;JLBELSHAN&gt; wrote in message
news:4162d971$1_3@newsprd01...
&amp;gt; You're in luck... you don't need to bully the textstring's, the VAL
function
&amp;gt; will take care of the values less than 10.... if your format is always
&amp;gt; 4-digit, padded with zeroes (and always integers), you could just use:
&amp;gt;
&amp;gt; dim too as string, from as string
&amp;gt; from="AB1204"
&amp;gt; too = Format(Val(Mid(from, 3, 2))) &amp;amp; "'-" &amp;amp; Format(Val(Mid(from, 5, 2))) &amp;amp;
&amp;gt; """"
&amp;gt; msgbox too
&amp;gt;
&amp;gt;
&amp;gt; HTH,
&amp;gt; James
&amp;gt;
&amp;gt;&lt;/JLBELSHAN&gt;</description>
      <pubDate>Tue, 05 Oct 2004 19:11:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151101#M49521</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-10-05T19:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: TextString Conversion Method?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151102#M49522</link>
      <description>I'm old school... I'm used to the Format$() function, which required a
numeric parameter.  So you had to go from string "09" to number 9 to string
"9".   The Format() function can apparently take a number OR a string value.
I didn't know it could do that.

James</description>
      <pubDate>Tue, 05 Oct 2004 19:35:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151102#M49522</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-10-05T19:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: TextString Conversion Method?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151103#M49523</link>
      <description>Thanks
:-)
Mark

"James Belshan" &lt;JLBELSHAN&gt; wrote in message
news:4162f79f$1_3@newsprd01...
&amp;gt; I'm old school... I'm used to the Format$() function, which required a
&amp;gt; numeric parameter.  So you had to go from string "09" to number 9 to
string
&amp;gt; "9".   The Format() function can apparently take a number OR a string
value.
&amp;gt; I didn't know it could do that.
&amp;gt;
&amp;gt; James
&amp;gt;
&amp;gt;&lt;/JLBELSHAN&gt;</description>
      <pubDate>Tue, 05 Oct 2004 20:33:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151103#M49523</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-10-05T20:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: TextString Conversion Method?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151104#M49524</link>
      <description>NP... I think I still like the old school way, though.  I'm not a big fan of
Variants -- if I'm not even sure what type of variable I'm passing to a
function, how likely is it that I know it has a valid value?  An example....
I was curious what would happen if I sent it a string that was semi-numeric,
so I tried Format("5.45a") thinking I'd get an error or "5.45".  The result
was  "5:45:00 AM".  In hindsight, it makes sense, but how many other
unexpected answers are there lurking out there?

Just my opinion.....

James</description>
      <pubDate>Tue, 05 Oct 2004 21:40:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151104#M49524</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-10-05T21:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: TextString Conversion Method?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151105#M49525</link>
      <description>Good questions. Thanks again. I learned alot.

Dan


"James Belshan" &lt;JLBELSHAN&gt; wrote in message
news:416314df$1_3@newsprd01...
&amp;gt; NP... I think I still like the old school way, though.  I'm not a big fan
of
&amp;gt; Variants -- if I'm not even sure what type of variable I'm passing to a
&amp;gt; function, how likely is it that I know it has a valid value?  An
example....
&amp;gt; I was curious what would happen if I sent it a string that was
semi-numeric,
&amp;gt; so I tried Format("5.45a") thinking I'd get an error or "5.45".  The
result
&amp;gt; was  "5:45:00 AM".  In hindsight, it makes sense, but how many other
&amp;gt; unexpected answers are there lurking out there?
&amp;gt;
&amp;gt; Just my opinion.....
&amp;gt;
&amp;gt; James
&amp;gt;
&amp;gt;&lt;/JLBELSHAN&gt;</description>
      <pubDate>Tue, 05 Oct 2004 23:59:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/textstring-conversion-method/m-p/1151105#M49525</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-10-05T23:59:41Z</dc:date>
    </item>
  </channel>
</rss>

