+ Reply to Thread
Results 1 to 10 of 10

how to pop-up the msgbox when the searching mismatches

  1. #1
    Registered User
    Join Date
    09-27-2014
    Location
    Africa
    MS-Off Ver
    2013
    Posts
    50

    how to pop-up the msgbox when the searching mismatches

    I learnt from my previous post to write a matching code.
    but now , if the matching fails, I want to add a msgbox to alert and the excel stuck.
    it seems that I did not wrote the right sentence.
    so if I want to alert that no matching was found, how this sentence should be in the "if"
    see my below wrong code.
    thks.Capture.JPG1.JPG

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: how to pop-up the msgbox when the searching mismatches

    I am not completely sure what you are asking, if you move the msgbox after the "Next d" , it will pop up after the loop.

    You may have to supply a sample workbook, instead of a picture, hard to work with a picture.

    moveHere.jpg

  3. #3
    Registered User
    Join Date
    09-27-2014
    Location
    Africa
    MS-Off Ver
    2013
    Posts
    50

    Re: how to pop-up the msgbox when the searching mismatches

    Hi,
    I have attached the excel.
    if the model# does not match the model# in sheet(4) & sheet(5) then there will be a masgbox to tell that "no match'
    but now when I add the magbox into the code, the excel stuck
    so something must be wrong, but I dun know.
    could you pls help me to check?
    thks.
    Attached Files Attached Files
    Last edited by VBAidot; 08-22-2016 at 04:25 AM.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: how to pop-up the msgbox when the searching mismatches

    Move the msgbox line and search the correct column, your workbook has you looping column "C"

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-27-2014
    Location
    Africa
    MS-Off Ver
    2013
    Posts
    50

    Re: how to pop-up the msgbox when the searching mismatches

    Hi,
    thks for ur reply.
    I have tried your modified code, but when there is a match found as shown in the below pic, it also poped up the msgbox, which will only be poped up
    when there is no mathch found.
    besides, I have to click twice to let the magbox disappear.
    could you pls help me to check again?
    thks
    Attachment 476737
    Attached Files Attached Files

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: how to pop-up the msgbox when the searching mismatches

    Try this.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: how to pop-up the msgbox when the searching mismatches

    Thanks for adding rep points.
    Suppose it's working now?

  8. #8
    Registered User
    Join Date
    09-27-2014
    Location
    Africa
    MS-Off Ver
    2013
    Posts
    50

    Re: how to pop-up the msgbox when the searching mismatches

    Hi bakerman2,
    yes, it's working well.
    thks.

  9. #9
    Registered User
    Join Date
    09-27-2014
    Location
    Africa
    MS-Off Ver
    2013
    Posts
    50

    Re: how to pop-up the msgbox when the searching mismatches

    Hi Bakerman,
    if it needs to meet
    1) sheets(2).textbox2. value match sheets(i).column(4).value
    and
    2) sheets(2).textbox1. value match sheets(i).column(3).value
    then copy the info
    I tried the match function but there was an error showed "object doesn't support this property or method"
    so if it needs to meet 2 conditions , then the match function can't use?
    thks.

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: how to pop-up the msgbox when the searching mismatches

    Sorry for delay in response. Been a bit busy lately.
    Try following.
    Please Login or Register  to view this content.

+ 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. Generate a list of mismatches between two excel docs
    By rockways in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-04-2016, 05:17 AM
  2. Indicating mismatches in 2 columns
    By Nare91 in forum Excel General
    Replies: 3
    Last Post: 06-11-2015, 03:18 AM
  3. comparing two sheets and extracting mismatches
    By Sarien in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-27-2014, 06:03 AM
  4. [SOLVED] How to display mismatches found between two columns?
    By MoRyn in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 03-23-2014, 04:03 PM
  5. [SOLVED] Count Formula for Matches in One Column and Mismatches in Another
    By xcel-noob in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-27-2014, 03:46 PM
  6. Compare cell values in two different columns for mismatches
    By maacmaac in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-11-2012, 01:33 AM
  7. Dynamic arrays and type mismatches
    By carg1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-01-2005, 03:13 PM

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