Stop users from inserting new lines and columns?

  • Thread starter Thread starter KuroNeko
  • Start date Start date
K

KuroNeko

Can one stop/prohibit users inserting new lines and columns into a workbook
in VBA?

How would one proceed?

Neko
 
Right click the excel icon in the upper left corner next to FILE>view
code>insert this. Modify to suit>SAVE the workbook

Private Sub Workbook_Open()
Worksheets(1).ScrollArea = "a1:f10"
End Sub
 
Can one stop/prohibit users inserting new lines and columns into a workbook
in VBA?

How would one proceed?

Neko

You could also just protect the sheet with a password. For your VBA
code to work you'd probably need to unprotect the sheet at the
beginning of your code and re-protect it at the end.
ActiveSheet.Unprotect/Protect

You can just record a macro doing the operation manually (right click
on the sheet tab) to see what the options are.
 
Right click the excel icon in the upper left corner next to FILE>view
code>insert this. Modify to suit>SAVE the workbook

Private Sub Workbook_Open()
Worksheets(1).ScrollArea = "a1:f10"
End Sub

Thanks, this is a very interesting routine that allows me to limit the
visible screen area. I've filed this for future use.

However, I could still create new rows and columns, the others simply
shifted lower or to the right outside the visible area.

Is it possible to actually stop the insert row/insert column functions?

Neko
 
You could also just protect the sheet with a password. For your VBA
code to work you'd probably need to unprotect the sheet at the
beginning of your code and re-protect it at the end.
ActiveSheet.Unprotect/Protect

Yes, that is an option, but I'd prefer it if I could disable the insert
(and delete) row/column functions via code. Is that possible?

Neko
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top