+ Reply to Thread
Results 1 to 10 of 10

VBA to show error message

  1. #1
    Registered User
    Join Date
    03-17-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    64

    VBA to show error message

    Hi,

    I am trying to build a tool in which user enters multiple data within a range A2:L100
    All users must enter a comment in the column I. Without entering it users are not allowed to move on to next row. If user start from A2, B2, .... H2, he must enter a comment in I2 aswell and only then he should go to A3. If the user skips I2 and tries to enter values in A3, a warning should pop-up. I tried to my level best but couldn't succeed. Looking for your help.

    Rakul.
    Attached Files Attached Files

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: VBA to show error message

    Hi Rakul

    Perhaps this could work...
    In Sheet1 Module
    Please Login or Register  to view this content.
    In std module
    Please Login or Register  to view this content.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    03-17-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    64

    Re: VBA to show error message

    Hi Sintek,

    Looks like it is not working. Did you try this?

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: VBA to show error message

    Yep...Tests fine...
    In attached... Complete columns A2:H2 and J2:L2....Leaving I2 blank...
    Then try and enter into A3...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-17-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    64

    Re: VBA to show error message

    Hi, Its not working for me. It allows to enter data in A3 if I leave I2 blank

  6. #6
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: VBA to show error message

    works for me...have you enabled macros

  7. #7
    Registered User
    Join Date
    03-17-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    64

    Re: VBA to show error message

    Yes, I have enabled them. Not sure what the problem causes.

  8. #8
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: VBA to show error message

    Try this....In sheet1 module
    Please Login or Register  to view this content.
    Last edited by Sintek; 02-15-2018 at 03:34 PM.

  9. #9
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA to show error message

    Hello rakul_rakul and sintek,

    Please try;

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    See attached sample Workbook.

    Regards.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  10. #10
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: VBA to show error message

    Another way
    -lazier, brute force approach

    place in sheet module
    Please Login or Register  to view this content.
    Last edited by kev_; 02-15-2018 at 06:47 PM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

+ 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. Replies: 5
    Last Post: 12-08-2016, 06:43 PM
  2. How to show an error message with incorrect date format
    By ramatthews in forum Excel General
    Replies: 5
    Last Post: 05-11-2015, 08:52 AM
  3. [SOLVED] On error, ignore error but show message box
    By chin67326 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-18-2015, 07:54 PM
  4. If Value Exists on another worksheet, show error message
    By BreatGritain in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-28-2014, 12:39 PM
  5. Simple code required to show message box on error
    By caabdul in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-24-2014, 04:08 PM
  6. Stop a Macro if Criteria not met and Show Error Message
    By m3hool in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-17-2013, 10:12 AM
  7. Run the Macro if cell value is YES, else show error message.
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-14-2008, 02:03 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