+ Reply to Thread
Results 1 to 7 of 7

vba excel - test userform entry greater than last entry

  1. #1
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    vba excel - test userform entry greater than last entry

    I've searched around, but not much luck. Assume a userform with a numeric text control entry and submit button. I've been struggling with requiring vba to evaluate the previous user sheet entry to the current user control entry. I'm looking for something akin to:
    Please Login or Register  to view this content.
    Basically the text control value cannot be smaller than the last cell data in range C.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: vba excel - test userform entry greater than last entry

    .
    Try this (use in your UserForm) :

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: vba excel - test userform entry greater than last entry

    I think this is really close. It works up until exactly 10000. Something is going on with the code when anything over 10000 is entered. I'm not sure why vba throws the message and sees 10000 as less than 9###. Do you have any ideas?

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: vba excel - test userform entry greater than last entry

    .
    Hmmm .... I'm using Excel 2007 ... placed a value at row 45,000 ... no problem.

    Wonder if it somehow has to do with ver 2016 ? It shouldn't ... the versions are mostly backwards compatible.

    I honestly don't know what to say.

    Just out of curiosity, highlight Col C / Rt Click and click CLEAR CONTENTS.

    Then enter your values all the way down past 10,000 rows again and try it. Maybe there is something of a residual value in the column that can't be
    seen.

    If that doesn't work ... I'm not certain what to suggest.

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: vba excel - test userform entry greater than last entry

    .
    My apologies .. I misunderstood what you meant 10,000.

    Edit the first few lines in the macro to this :

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: vba excel - test userform entry greater than last entry

    Perfect. Works great.

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: vba excel - test userform entry greater than last entry

    .
    You are welcome.

    Cheers.

+ 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. Missing entry test for each row
    By delioff in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-22-2015, 08:29 PM
  2. Userform adds entry new entry instead of updating existing
    By rayexcel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2014, 04:27 AM
  3. Replies: 0
    Last Post: 02-04-2014, 12:36 AM
  4. [SOLVED] After userform entry require tab entry
    By Tiger20 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2013, 12:24 AM
  5. [SOLVED] To Lock Excel Worksheets and only allows Update/Add entry via Userform
    By waihar in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-19-2013, 02:38 AM
  6. Creating Data Entry MIS in Excel Sheet without an Userform
    By sumit dey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-12-2013, 04:01 AM
  7. Replies: 2
    Last Post: 07-09-2012, 02:05 AM

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