+ Reply to Thread
Results 1 to 12 of 12

Trouble with validation

Hybrid View

  1. #1
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500

    Question Trouble with validation

    Hi

    I have a user form which has a First entry and which the user enters in data after which they press ok and the data is insertedinto the spreadsheet. however on the validation page which the user enters in the same data i have some validation code which searchs the list of data and then if a cell is not equal to what the user has entered it brings up an input box with the two different figures and askes them to choose.

    All is working except that when it gets to the different data is keeps on poping up asking which is correct and both figures with the input box is showing is exactly the same. any ideas?

    If ActiveCell.Offset(0, -11).Value <> CJ_val Then
    answer = InputBox("Which answer is correct for CJ Hours? A: " & ActiveCell.Offset(0, -11).Value & " or B: " & CJ_val & ". Please type A or B and press OK.")
    If answer = "B" Or answer = "b" Then
    ActiveCell.Offset(0, -11).Value = CJ_val.Value
    End If
    End If
    The above code the validation part. say the user first entered in 1 (As the user only has to enter in 1-10 and thats it, and the second time they enter it in as 1 it comes up asking if the right answer is 1 or 1?

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    probably one of them is being treated as text, while the other as a number...


    Mangesh

  3. #3
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    how do i check?

  4. #4
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    what is cj_val
    for the cell, just check in another cell, if
    =ISTEXT(A1) should return true for text and false for number

    Mangesh

  5. #5
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    ok the activecell.offsets are numbers. cj_val is the name of the textbox. how do i do a check on the textbox?

  6. #6
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    Try CJ_val.Value

    Mangesh

+ 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