×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

preventing users from adding rows in excel

preventing users from adding rows in excel

preventing users from adding rows in excel

(OP)
I built a bunch of macros to aid users in filling out information in excel spreadsheets. I am wondering how to prevent the user from adding rows with out locking cells. What I have is a timesheet that has a certain number of rows and fits nicely on one sheet of paper. If they require more rows then they are to start a new sheet.

I am wondering does a sheet have an add row event?

Troy Williams B.Eng.
fenris@hotmail.com
 
 

RE: preventing users from adding rows in excel

I don't think that Excel has an AddRow event. The best way to accomplish this is to protect the worksheet. You will have to turn the protection option off on the cells that can accept data. This will preserve the format of the worksheet without limiting data entry. You can toggle the protection from within your macro if needed.

Another option would be to have a macro review the time sheet to check the number of rows. If the max number is exceeded, you can warn the user and force them to fix it before continuing.

RE: preventing users from adding rows in excel

(OP)
Thanks for the ideas, they were similar to what I had in mind but I thought I should ask to see if there were better (easier) ways to accomplish what I needed.



Troy Williams B.Eng.
fenris@hotmail.com
 
 

RE: preventing users from adding rows in excel

Take a look at.

Private Sub Workbook_BeforeSave(ByVal SaveAsUi As Boolean, Cancel As Boolean)

By canceling all save events the workbook is essentially 'locked'. Further, you might provide a message box to explain this to the user at that point.




Amiel
amielzz@netscape.net
 
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close