Results 1 to 10 of 10

Vba code to check a number in a cell against numbers in a column

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-14-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    120

    Vba code to check a number in a cell against numbers in a column

    Dear All,

    I should be grateful if you would, please, help me with a vba code to check the correctness of the number in a given cell and also check if there is a duplicate of that number in a particular column. Here is the scenario:

    1. The worksheet I am working on is named 'Products'

    2. A number is keyed into e.g. Cell H5. The number format is 2 alphabets followed by 3 numbers e.g. 'DV001'.

    3. The code should check that whatever number that is entered into that cell must have 2 alphabets followed by 3 numbers: If not, there should be a msg saying that the number is invalid - to be re-entered.

    4. If the number meets that first test, then the code should check the number against all the numbers in say 'Column J' to ensure that the same number doesn't already exist in that column. If it exists, there should be a msg saying it is a 'duplicate number' - so that a different number could be entered into the cell..

    I am very new with vba and don't know how to put this together.

    I will be very glad for any help, please.

    Buddy
    Last edited by Buddy8; 10-05-2014 at 07:41 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Find numbers in a column that equal a number in a cell.
    By frankday in forum Excel General
    Replies: 5
    Last Post: 09-30-2014, 04:43 AM
  2. Check if a cell contains text copy number to new column
    By lto120636 in forum Excel General
    Replies: 5
    Last Post: 07-14-2014, 08:39 AM
  3. Code to check the number of rows between last data cell in G and F.
    By Nitefox in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-13-2014, 09:34 PM
  4. Replies: 8
    Last Post: 11-18-2013, 04:24 PM
  5. check to see if a number is between two numbers
    By GrantShoe in forum Excel General
    Replies: 8
    Last Post: 01-02-2013, 04:17 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