+ Reply to Thread
Results 1 to 2 of 2

Adding text box values.

  1. #1
    Registered User
    Join Date
    10-28-2004
    Location
    Scotland
    Posts
    1

    Adding text box values.

    Hi Folks,

    Currently working through a procedure that will arithmetically sum the values in two text boxes on a userform.

    Unfortunately no matter how I declare the variables or manipulate the addition all I seem to get is a text sum of the values -

    ie 15000 + 15000 = 1500015000

    Any help would be much appreciated as its doing my head in and stopping me progressing the project.

    Thanks
    G

  2. #2
    Forum Contributor
    Join Date
    11-16-2004
    Posts
    282

    Adding text box values

    You must convert the data type of the value in the textbox from text to an actual number...

    Dim myVal1, myVal2, totVal
    myVal1 = Val(TextBox1.Value)
    myVal2 = Val(TextBox2.Value)
    totVal = myVal1 + myVal2

    Hope this helps,
    theDude

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1