info box pop

  • Hi, Hope All are fine.

    I am having a problem creating a popup message box with conditions.

    The fact is if the Target Cell range (AI9:AI1200) is 0 then it shows a specific message

    if the Target Cell range (AI9:AI1200) is 1 then it shows another specific message.

    If error then shows another message.

    I am using the below code, please help me to change this code with the above condition.

    I anything is not understandable then please tell me I will try to explain better.

    A sample file will be enough for me to understand better.

    Any help will be appreciatable.

    Thanks and best regards.

  • Hi MA,

    The code you have provided does not really do anything like what you are requesting, is there a reason you are using a combination of system popup and msgbox rather than just using msgbox?

    Do you want a message to be displayed when a cell changes or do you want a macro to run through the ranges and popup/msgbox on all values?

  • It's good that you worked out what it was. To close this thread, please either add your answer and accept it as an answer: this could help others (recommended) or remove the post (not recommended)

  • Thanks, Royuk.

    I like your recommendation and will follow it in the future too.

    I solve the problem by the below code. Hope it helps others.

    Thanks again for the support.

  • Hi, Royuk,

    Can you give me any idea how to do it with the excel message box feature.

    How to write the same code with the excel message box.

    Thanks again.

  • I've used a Select Case but you can use the IF statement.

    I don't know why you declare MyNum1, etc as Strings, I would expect them to Integers.

    Dim MyNum as String, MyNum1 as String, MyNum2 as String, MyNum3 As String

    The above is not the correct way to declare the variables, they will not all be Strings only the last one. See my code for the correct way.

  • Thanks royUK.

    Always <3the way this forum helps us.

    In my code message box auto shut after 10 seconds but In your code It needs to close manually.

    Though it does not cause me a lot, if it is possible that the message box will close after 10 seconds then It will be fantastic work. :thumbup:

    Thanks again and best regards.:)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!