+ Reply to Thread
Results 1 to 6 of 6

Zero value in userform textbox

  1. #1
    Registered User
    Join Date
    07-26-2010
    Location
    NL
    MS-Off Ver
    Excel 2016
    Posts
    74

    Zero value in userform textbox

    Hello,

    I.ve got a problem regarding a userform textbox, when i load the userform some values are loaded (see code)

    Please Login or Register  to view this content.
    Everything works fine untill the formula in cel D6 returns zero, then the textbox is empty istead of showing 0.

    Anyone an idea?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,696

    Re: Zero value in userform textbox

    Change .Text to .Value
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Zero value in userform textbox

    The code works fine for me if I comment out the second line where you put the value from D7 into TextBox2.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    07-26-2010
    Location
    NL
    MS-Off Ver
    Excel 2016
    Posts
    74

    Re: Zero value in userform textbox

    6StringJazzer,

    Works like a charme, thanks.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,696

    Re: Zero value in userform textbox

    Well, now I'm confused because Norie noted a problem that could not possibly be fixed by my suggestion. Please note your first line of code has no effective because the second line writes a different value into the text box. Do you mean for this to be two different text boxes?

  6. #6
    Registered User
    Join Date
    07-26-2010
    Location
    NL
    MS-Off Ver
    Excel 2016
    Posts
    74

    Re: Zero value in userform textbox

    Quote Originally Posted by 6StringJazzer View Post
    Well, now I'm confused because Norie noted a problem that could not possibly be fixed by my suggestion. Please note your first line of code has no effective because the second line writes a different value into the text box. Do you mean for this to be two different text boxes?
    My bad, "copy pasted" en did not change it correctly!
    In the code there are multiple textboxes refering to different cells.

    The issue was only on one textboxes.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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