Results 1 to 3 of 3

Thread: Warning message

  1. #1
    New Lounger
    Join Date
    Dec 2000
    Location
    Denver, CO
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Warning message

    My work group is sending an Excel workbook to the field for use in evaluating performance. It's set up with a certain number of rows which must remain static so the macros will work.

    We can't protect it, because it will be used by the field to input data; they also can customize it for their unit.

    However, it will mess up the workbook if they add or delete rows to the database area.

    My question: How can I have a message box pop up with a warning whenever someone attempts to add or delete a line?

    Thanks for any suggestions!

  2. #2
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Warning message

    Hi Rick,

    Couple of suggestions:

    1-In your macros, you might use the .UsedRange method to count the number of rows and columns and therefore make your macros able to be flexible with the data contained.

    2-You can use the Worksheet_Activate event to display a userform containing your warning.

    3-Protect the sheet. Unprotect the cells which you wish to have the data entered.

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Warning message

    If you are not using all of the columns in the rows you don't want deleted, then just protect some or all of the unused cells in the row and the user will not be able to delete the rows.

    If your concern is that some cells where the user must enter data can not be left empty (ie. the initial content deleted and not replaced with something new), then you can use data validation to display a message if the user trys to do that. You can also use the WorksheetChange event to check if the user has changed a cell incorrectly.
    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •