+ Reply to Thread
Results 1 to 5 of 5

Userform textbox sum

  1. #1
    Registered User
    Join Date
    04-02-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    3

    Userform textbox sum

    Hi, I'm trying to make a condition in a userform that if deposit is less then property value * 0.05 then msgbox "etc"

    However, when I run the code so that the deposit is less than propertyvalue * 0.05, the msgbox doesn't appear?

    Any help would be greatly appreciated.

    If the image I've attached doesn't work then here is the code I've written

    If Deposit < PropertyValue * 0.05 Then MsgBox "Sorry, deposit must be a minimum of 5% of the property value"

    Problem.png

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Userform textbox sum

    Submit your workbook.

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

    Re: Userform textbox sum

    Is the code actually being executed?

    PS Why do you have a loop for checking for numeric input for Deposit?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    04-02-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    3

    Re: Userform textbox sum

    Hi, I'm very new to VBA and so I'm struggling a bit. Someone else suggested putting a loop in there although I don't think it needs it. Do you mean I should upload my workbook onto here? Everything else I've done is working fine except for this, it wont execute it.

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

    Re: Userform textbox sum

    If Deposit is a textbox then you need to convert it's text value to numeric if you want to compare it with another numeric value.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Excel 2010 - Userform - display date from textbox in a label or textbox in 'ddd' format
    By theshybutterfly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2015, 10:54 PM
  2. Replies: 23
    Last Post: 07-12-2014, 07:09 PM
  3. Replies: 3
    Last Post: 05-07-2012, 09:46 PM
  4. Userform Textbox updating a another userform textbox (im stuck!!)
    By wapwap in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-31-2011, 02:56 PM

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