View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Norman Harker Norman Harker is offline
external usenet poster
 
Posts: 162
Default Protection & Macros

Hi Martyn!

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



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

"Martyn" wrote in message
...
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