ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Protecting excel sheet for data input (https://www.excelbanter.com/excel-discussion-misc-queries/119904-protecting-excel-sheet-data-input.html)

rdrnws

Protecting excel sheet for data input
 
Dear All:

I am using Excel for inputting data as part of a larger application. Each
worksheet roughly corresponds to a table for user input. Each table has a
predefined number of columns, the rest of the columns in the worksheet are
not being used and can be hidden from the user. My concern is about the data
area of the worksheet, which I am not protecting in any way because I want
the user to be able to modify the data at will. During this process, the
user may, for example, accidentally delete a useful table column. So I am
looking for a way to at least prevent column deletion while allowing data
input/editing functions. Also, the data area of the worksheet contains
defined names. How can I protect these from deletion as well?

TIA for all suggestions,

Nikolas

ps. I will be using VBA to implement protection of the data table



Nigel

Protecting excel sheet for data input
 
A simple password protection applied to all sheets might be enough?

Sub protectsheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True,
Password:="Password"
Next
End Sub

Sub unprotectsheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Unprotect ("Password")
Next
End Sub

--
Cheers
Nigel



"rdrnws" wrote in message
...
Dear All:

I am using Excel for inputting data as part of a larger application. Each
worksheet roughly corresponds to a table for user input. Each table has a
predefined number of columns, the rest of the columns in the worksheet are
not being used and can be hidden from the user. My concern is about the
data
area of the worksheet, which I am not protecting in any way because I want
the user to be able to modify the data at will. During this process, the
user may, for example, accidentally delete a useful table column. So I am
looking for a way to at least prevent column deletion while allowing data
input/editing functions. Also, the data area of the worksheet contains
defined names. How can I protect these from deletion as well?

TIA for all suggestions,

Nikolas

ps. I will be using VBA to implement protection of the data table






All times are GMT +1. The time now is 07:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com