+ Reply to Thread
Results 1 to 3 of 3

vbNo running even if test not true

  1. #1
    Registered User
    Join Date
    08-06-2012
    Location
    Bracknell, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    vbNo running even if test not true

    Hi All

    Can anyone help with the below, I have a user form that defaults the current date, however the user can change this date. When the code runs it checks if a line has already been added for the date in the box, I have got to the point where I can get a message box come up asking if the user wants to overwrite. However if the date has not already been used it should add the input into the next available row, I can get this to work if I take out the checking loop however when this loop is in place the code seems to stop at vbNo even though no msg box has come up for user input????

    Any suggestions would be welcomed.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: vbNo running even if test not true

    First off, you are assign a string to an integer in
    iRet = "0"
    It should be iRet = vbNo. (And BTW, vbNo is 7, not 0. )

    Add the cdate to the range.

    You can simplify the test to this.

    Please Login or Register  to view this content.
    Test variable is not needed.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    08-06-2012
    Location
    Bracknell, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: vbNo running even if test not true

    Thanks Tinbendr I was trying allsorts to get the code to work

+ 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