Announcement

Collapse
No announcement yet.

Convert Percent Textbox Into A Calculated No.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Convert Percent Textbox Into A Calculated No.

    Hi There
    I Have A Textbox contains a Percent No(eg: 1.00%) Whenever A calculation Is To be Done Software Does Not Recognize The Percent Number. I tried All Possible Ways To Convert Like Clng,Cdbl,Csng, Format Textbox No Use

    Any Way I Could Find help here n The Forum?????/



    Thanks In advance

  • #2
    wkalo,

    You need to strip away the % sign and convert the result to a number:

    eg
    Sub myResult()


    Dim i As Integer, x As Integer, y As String

    'y is value entered in the textbox ie. 1.00%
    y = TextBox1.Value

    'i is the everything left of the % sign, decalred above as an integer
    i = Left(y, Len(y) - 1)

    x = TextBox2.Value

    msgbox i + x


    End Sub

    Hope that helps
    Weasel
    Kind Regards
    Pesky Weasel
    "I have a plan so cunning, you could put a tail on it and call it a Weasel." EB
    Eagles may soar, but Weasels don't get sucked into jet engines.
    Templates and Calculators
    The Way of the Weasel
    Download Ivan & Colo's HTML Maker Here
    101 Excel Hacks - Great New Book
    Huge Savings on Excel Training

    Comment


    • #3
      Thank You Very Much Problem Is Solved !!!!

      Comment

      Working...
      X