+ Reply to Thread
Results 1 to 9 of 9

checking a number if its in spreadsheet

  1. #1
    Registered User
    Join Date
    06-09-2010
    Location
    US, US
    MS-Off Ver
    Excel 2003
    Posts
    12

    checking a number if its in spreadsheet

    hey all,

    I want to create something that will check to see if a number matches another number in the #Number column.

    A simple if statement may be used: if the number matches exactly, return TRUE or if the number does not match, return FALSE.

    The only problem is that the spreadsheet cannot be changed. This is more of a style issue. What is the best way to do something like this? An input button? a Dropdown?

    please let me knw if clarification is needed.

    Also note - the number in the #number column is inputted as text and not number. Again, the spreadsheet cannot be changed so we would have to make due with it.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: checking a number if its in spreadsheet

    You can use an inputbox to get the number that you want to search for and then the VBA Find method so search the sheet or range. The Find Method will return a Range object if it finds a match, if it doesn't it will remain as Nothing.

    The VBA help has an example of the Find method but post back if you need more help.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    06-09-2010
    Location
    US, US
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: checking a number if its in spreadsheet

    thanks for responding. I have several questions since I am very new at excel. Where do i find the inputbox and im not sure if i want to use vba find. I want it to return a Found rather than the string of numbers.

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: checking a number if its in spreadsheet

    What are you wanting to do if you do find a match?

    Dom

  5. #5
    Registered User
    Join Date
    06-09-2010
    Location
    US, US
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: checking a number if its in spreadsheet

    it will say FOUND

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: checking a number if its in spreadsheet

    Do you want that message to appear in a cell in another workbook or in a popup message or something else?

    It's the whole bit about you saying the spreadsheet can't be changed that I'm struggling with and I'm assuming you can't just search using Ctrl+F.

    Dom

  7. #7
    Registered User
    Join Date
    06-09-2010
    Location
    US, US
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: checking a number if its in spreadsheet

    a popup message would be perfect since we are doing an input box.

  8. #8
    Registered User
    Join Date
    06-09-2010
    Location
    US, US
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: checking a number if its in spreadsheet

    anyone? thanks

  9. #9
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: checking a number if its in spreadsheet

    Try this:

    Please Login or Register  to view this content.

    It will search column A on the active sheet. If you want to always search a particular sheet let me know.

    Dom

+ 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