Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Protecting sheet temporarly

Hello ALL

I Have written a Macro which opens a dialog and
ask user to enter some data. After recving the
data, I enter this data to the sheet.

Now How do i restrict user to enter only data
thru my dialog. Since if user tries to modify
or delete the data dierctly from the xls sheet,
it will be a problem. Can we protect the sheet?

When user enter the data in the dialog, we will
remove the protection and once he closes the dialog
we will enable the protection. Can v do this?

Thanks In Advance

Reg


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Protecting sheet temporarly

I would be inclined to do the opposite, i.e. Protect your sheet for normal
usage, and unprotect it when you want to manipulate the data.

If you set a protection password for your sheet, you can unprotect your
sheet with the code line:

ActiveSheet.Unprotect Password:="Password"

and re-protect it with the line

ActiveSheet.Protect Password:="Password"

You will of course need to make sure that the sheet you want to protect /
Unprotect is the current active sheet.

If you decide to protect your sheet, something like the following code would
work:

VariableName = Inputbox ("Enter Data")
ActiveSheet.Unprotect Password:="Password"
Range ("A1").Select
ActiveCell = VariableName
ActiveSheet.Protect Password:="Password"

HTH

Neil
www.nwarwick.co.uk

"Imran" wrote:

Hello ALL

I Have written a Macro which opens a dialog and
ask user to enter some data. After recving the
data, I enter this data to the sheet.

Now How do i restrict user to enter only data
thru my dialog. Since if user tries to modify
or delete the data dierctly from the xls sheet,
it will be a problem. Can we protect the sheet?

When user enter the data in the dialog, we will
remove the protection and once he closes the dialog
we will enable the protection. Can v do this?

Thanks In Advance

Reg



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protecting a Sheet Shannan Excel Discussion (Misc queries) 7 September 30th 09 12:06 AM
write in a cell and the cell above is temporarly hidden amuw Excel Worksheet Functions 0 June 18th 09 05:38 PM
protecting formulas without protecting sheet so grouping still wor JM Excel Discussion (Misc queries) 1 June 4th 09 06:42 AM
protecting sheet Art Cummings New Users to Excel 1 May 14th 09 06:14 PM
Protecting Sheet purplerayn Excel Worksheet Functions 1 October 21st 05 12:55 AM


All times are GMT +1. The time now is 10:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"