+ Reply to Thread
Results 1 to 9 of 9

To check in a column a certain criteria meets and display dialog box

  1. #1
    Forum Contributor
    Join Date
    10-08-2013
    Location
    Chennai, INDIA
    MS-Off Ver
    Excel 2010
    Posts
    157

    Question To check in a column a certain criteria meets and display dialog box

    Hi All,

    I have coloumn B with codes represent regions.. which all are in numbers like 321,546,231,895,125, etc...

    in this i need a macro to check certain codes 504,556,943...etc, if any of these codes available it should display a msg box saying "There are major codes" with vbokcncl.. if those major codes are not trhere it should display as "There is no Major codes"...

    I tried it with IF and simple msgbox but i failed..

    Appreciate your work i thisa thanks... For your refernce i have attached a sample excel.
    Attached Files Attached Files
    Bala

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: To check in a column a certain criteria meets and display dialog box

    Can you not do by an Excel Formula?
    =IF(ISERROR(MATCH(B2,$D$2:$D$4,0)),"N","Y")
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: To check in a column a certain criteria meets and display dialog box

    Maybe:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    10-08-2013
    Location
    Chennai, INDIA
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: To check in a column a certain criteria meets and display dialog box

    Hi natahnsav... Thanks.....

    Hi John,

    Thanks.. works fine... But i expected a simple macro which says only if the major code available msgbox "There is major codes" and if no msgbox as "There is no Major codes"

    Thanks expecting reply......

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: To check in a column a certain criteria meets and display dialog box

    Hi, Bala,

    maybe
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  6. #6
    Forum Contributor
    Join Date
    10-08-2013
    Location
    Chennai, INDIA
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: To check in a column a certain criteria meets and display dialog box

    Hi HaHoBe,

    Thanks...

    Have a query and need a solution.. lets forget about the example excel i have uploaded...

    I have 1000 random number in column B, if the random number list contains any of these "558", "546", "766", "564", "566", numbers, Msg box should display as "There is codes in the list"and if there is no above said numbers present then msgbox should display "There is no codes in the list"...

    Thanks....

  7. #7
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: To check in a column a certain criteria meets and display dialog box

    Hi, Bala,

    sorry, I donīt understand what you are after. The code supplied does what you requested, if you want anything changed you would need to put that in words.

    Ciao,
    Holger

  8. #8
    Forum Contributor
    Join Date
    10-08-2013
    Location
    Chennai, INDIA
    MS-Off Ver
    Excel 2010
    Posts
    157

    Question Re: To check in a column a certain criteria meets and display dialog box

    Hi HaHoBe,

    I have attached a fresh excel with clear information... Hope am clear this time... Thanks a lot...
    Attached Files Attached Files

  9. #9
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: To check in a column a certain criteria meets and display dialog box

    Hi, Bala,

    These are major codes, actually it wont present in excel these numbers in D column is only for reference…
    The code I supplied still comes up with what I understood from your request, and I canīt understand what you are asking for now.

    Ciao,
    Holger

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need one column total if criteria meets another columns criteria
    By jebrown in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-24-2013, 08:47 PM
  2. [SOLVED] If range meets criteria then display text in another cell
    By NSimp216 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-05-2013, 05:25 PM
  3. Display Cell Range if it meets Criteria x
    By karobonas in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-21-2012, 12:17 PM
  4. Replies: 0
    Last Post: 02-07-2012, 12:13 PM
  5. How to check if a file exists, and display a custom dialog box
    By CantripGhost in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-19-2011, 11:35 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