Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Protection & Macros

How can I protect cells within my worksheets allowing
macros to enter data into them but not users???

Thanks in advance.

Catherine.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Protection & Macros

Hi Catherine!

You need to insert code into your macros:

For j = 1 To Worksheets.Count
Worksheets(j).UnProtect Password:="not4u2see"
Next j

<your code that enters data

For j = 1 To Worksheets.Count
Worksheets(j).Protect Password:="not4u2see"
Next j



The above allows entry of data into any of the sheets assuming all use
the same password. Modify for a single sheet with data entry or where
you use different passwords for different sheets.


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia

"Catherine" wrote in message
...
How can I protect cells within my worksheets allowing
macros to enter data into them but not users???

Thanks in advance.

Catherine.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Protection & Macros

Alternatively, set the UserInterFaceOnly argument to true
eg
Worksheets("Sheet1").Protect password:="password"
UserInterFaceOnly:= True

-----Original Message-----
Hi Catherine!

You need to insert code into your macros:

For j = 1 To Worksheets.Count
Worksheets(j).UnProtect Password:="not4u2see"
Next j

<your code that enters data

For j = 1 To Worksheets.Count
Worksheets(j).Protect Password:="not4u2see"
Next j



The above allows entry of data into any of the sheets

assuming all use
the same password. Modify for a single sheet with data

entry or where
you use different passwords for different sheets.


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia

"Catherine" wrote

in message
...
How can I protect cells within my worksheets allowing
macros to enter data into them but not users???

Thanks in advance.

Catherine.



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Protection & Macros

Hi,

Usee the ActiveSheet.Unprotect "david"<< your password
At the begining of the Macro and when macro is done reset th
password.
ActiveSheet.Protect Password:="david"<<<< your password.


HTH Charle

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Protection & Macros

Hi Norman,
But can we prevent users not to "see" the password from the macro code?
TIA

"Norman Harker" wrote in message
...
Hi Catherine!

You need to insert code into your macros:

For j = 1 To Worksheets.Count
Worksheets(j).UnProtect Password:="not4u2see"
Next j

<your code that enters data

For j = 1 To Worksheets.Count
Worksheets(j).Protect Password:="not4u2see"
Next j



The above allows entry of data into any of the sheets assuming all use
the same password. Modify for a single sheet with data entry or where
you use different passwords for different sheets.


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia

"Catherine" wrote in message
...
How can I protect cells within my worksheets allowing
macros to enter data into them but not users???

Thanks in advance.

Catherine.





---
Outgoing mail is certified Virus Free.
(Giden posta virüssüz olarak belgelendi.)
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.703 / Virus Database: 459 - Release Date: 10.06.2004




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Protection & Macros

I already know that...but thank you anyway.
Best wishes
Martyn


"Norman Harker" wrote in message
...
Hi Martyn!

Protect the Macro code. It's under the Tools menu in VBA.



--
Regards
Norman Harker MVP (Excel)
Sydney, Australia




---
Outgoing mail is certified Virus Free.
(Giden posta virüssüz olarak belgelendi.)
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.703 / Virus Database: 459 - Release Date: 10.06.2004


---
Outgoing mail is certified Virus Free.
(Giden posta virüssüz olarak belgelendi.)
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.703 / Virus Database: 459 - Release Date: 10.06.2004


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
Excel protection & macros Neil Pearce Excel Discussion (Misc queries) 7 February 14th 08 02:20 PM
Cell/worksheet protection with macros enabled Zilla[_2_] Excel Worksheet Functions 7 March 6th 07 01:07 AM
Macros/Protection/Pivot Tables...HELP KDG Excel Discussion (Misc queries) 0 October 19th 06 08:45 PM
how to hide a list of macros without password protection Padam Excel Worksheet Functions 1 July 12th 06 11:30 AM
macros and protection SYBS Excel Worksheet Functions 9 May 24th 06 06:52 PM


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

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

About Us

"It's about Microsoft Excel"