+ Reply to Thread
Results 1 to 9 of 9

when typing to a cell check if this number exist in a range of cells (in sheet 2)

  1. #1
    Registered User
    Join Date
    11-28-2008
    Location
    cyprus
    Posts
    12

    when typing to a cell check if this number exist in a range of cells (in sheet 2)

    I need help to this : When i type a number to a cell and press enter , i want to check if this number exist in a range of cells (in sheet 2) , and if exists , excel show me a message. Actually i use it for my dvd club. Number is the client code. When i writte 50 in a cell , i need from excel to check if this client own me money , and show me some message..
    Thnaks
    Last edited by VBA Noob; 11-28-2008 at 01:19 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Perhaps you can use Data Validation for this... no programming

    Select the list in Sheet2 and name it something like List through Insert|Name|Define

    Then go to the input cell in Sheet1 and go to Data|Validation

    Select Custom from the Allow options and enter formula:

    =ISNA(MATCH(A1,List,0))

    Where A1 is the input cell

    Then select the Error Alert Tab and enter a Title and message you want to appear.

    Click Ok. Test it.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You could also use VLOOKUP to check the amount owed if the data is stored in the same table as the IDs
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    11-28-2008
    Location
    cyprus
    Posts
    12
    thank u for your answers

    however the check must take place from a range of input cells to a range of comparison cells of deferent sheets. i thing from the data validation this canot happen

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by gtserkou View Post
    thank u for your answers

    however the check must take place from a range of input cells to a range of comparison cells of deferent sheets. i thing from the data validation this canot happen
    It should do with Named Ranges, attach an example workbook

  6. #6
    Registered User
    Join Date
    11-28-2008
    Location
    cyprus
    Posts
    12
    still haven't archive anything

    eg.

    sheet1
    column(D)

    4
    6
    9
    14
    67
    5
    43
    32


    sheet2
    column(c)

    _
    _
    _
    _
    _
    _
    _ (Empty cells)

    when i give a value to any cell of sheet2.column(c), it must me compared with all the values of sheet1.column(d) and return a message if equal

    with data validation it returns an error when I try the formula with a range of cells

    if you can provide me a sample code it would be great


    thanks in advanced

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    attach an example workbook!

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    See attached.

    Enter any value in any of the bordered boxes in Column C. If the value exists in Sheet2, column D, you will get a message...

    To extend the validation down column C... just copy any cell with validation.. select the range you want to copy to and go to Edit|Paste Special.. select Validation.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-28-2008
    Location
    cyprus
    Posts
    12
    thanks for all of your help

    i finily did it...

+ 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