+ Reply to Thread
Results 1 to 11 of 11

Message box needed in VBA

  1. #1
    Registered User
    Join Date
    07-30-2013
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Message box needed in VBA

    Hi All,

    Can any of you please provide me the code for Message box where I have a range of A2:A500 and B2:B500 and C2:C500

    If A2:A500 is "Yes" then message should be " Incorrect code"
    IF B2:B500 is "Yes" then message should be " Incorrect amount"
    IF C2:C500 is "Yes" then message should be " Not Matching"

    Thank you so much for your time.

    Mitta..
    Last edited by mitta235p; 08-01-2013 at 10:49 AM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Message box needed in VBA

    explain better please, if all cells in range A2:A500 are "Yes" then message should be " Incorrect code" ? or one ?
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    07-30-2013
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Message box needed in VBA

    Hi,

    Sorry for the confusion caused.

    If any of the cell in A2:A500 contains "Yes" message should be "incorrect code" also it would be great help if message tells which cell is incorrect.

    Thank you

  4. #4
    Registered User
    Join Date
    06-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    90

    Re: Message box needed in VBA

    Hi, I have a sample code here for you to try. It does everything you said except telling which cell is incorrect, but I'm working on that. Is the formatting of the msgbox okay? This will give you all the errors in one msgbox instead of multiple popping up.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-30-2013
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Message box needed in VBA

    Hi

    Looks fine thank you!!!

    It would be great if we are able to find which cell went wrong...

    Even if its not possible, could you please add another message stating that "every thing's good - No errors" if there is no Yes in any of cells in A,B& C?

    Again... thanks a ton!!

  6. #6
    Registered User
    Join Date
    06-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    90

    Re: Message box needed in VBA

    Glad that works for you! To get that no error message just add
    Please Login or Register  to view this content.
    before the End If line.

    I'm working on showing the cell for any error. Do you want every cell that has YES in it to be listed as such?

  7. #7
    Registered User
    Join Date
    07-30-2013
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Message box needed in VBA

    Hi

    Yes, It would tell the inputted person which cells are incorrect..

    Thank you so much!!

  8. #8
    Registered User
    Join Date
    06-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    90

    Re: Message box needed in VBA

    I'm having a difficult time figuring that out. I think it can be done, but it'd require some knowledge I do not possess. Are you against using conditional formatting to highlight cells when they have yes in them? It would be easier to find them that way if you have to change them, since you'll have to write down your list of incorrect cells and then go find them anyway.

  9. #9
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Message box needed in VBA

    attach a sample file for testing

  10. #10
    Registered User
    Join Date
    07-30-2013
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Message box needed in VBA

    Thank you so much... I used conditional formatt and I'm good now!

  11. #11
    Registered User
    Join Date
    06-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    90

    Re: Message box needed in VBA

    I'm glad I could help! If my responses were what you were looking for, don't forget to Add Reputation to me by clicking on the star under my posts

+ 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. [SOLVED] Warning Message needed prior to clearing spreadsheet
    By jrtdcg in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-29-2012, 12:41 PM
  2. [SOLVED] Help needed with answering a message box
    By guydixon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2012, 12:46 PM
  3. Code adjustment needed-warning message and highlighting is deactivated.
    By baffled1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-01-2011, 09:23 PM
  4. VBA-Error Message Assistance Needed
    By MLS7181 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-03-2006, 04:00 PM
  5. .dll error message help needed
    By Wylie C in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-01-2005, 04:09 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