+ Reply to Thread
Results 1 to 4 of 4

Error adding using Textbox

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Error adding using Textbox

    Hi.

    I have 5 textbox.

    The (file) code below only works when the 3 textbox are filled with values​​.

    case is filled to textbox1 and textbox2, and the TextBox3 went blank, generates an error message.

    case is completed and the textbox2 TextBox3, and the textbox1 went blank, generates an error message.

    anyone know why this happens?

    thank you!
    Attached Files Attached Files
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  2. #2
    Registered User
    Join Date
    04-17-2013
    Location
    Columbia, MO
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Error adding using Textbox

    After taking a quick peek at the file it looks like your functions are referencing the textboxes but not error checking to determine if there is a blank value. You might try defaulting the textboxes to some value (say, 0), or doing a quick check to determine if the textbox has a valid value prior to using that value in a calculation.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Error adding using Textbox

    VBA can't add blank cells.
    It maybe just as easy to set the textboxes to equal zero if they are blank, for example:
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Error adding using Textbox

    Hi.

    Very good!!

+ 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