Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ed ed is offline
external usenet poster
 
Posts: 59
Default Macro , Unprotect-Protect -- Atten: Tom Ogilvy

Hi Tom
Thankyou for your help on this yesterday.
I put the following in my macro:

(at the start) Worksheets("abc").Unprotect

(at the end) Worksheets("abc").Protect

Basicly this works fine with one major problem.
You can't protect the sheet with a password.
If you do, you have to enter the password befor you can
run the macro. Then the password protection is gone.

What I need is this. After the above macro is run, I
need not only the sheet to be protected but still be
protected with a password. So that only the person that
knows the password can change a cell. That person being me.

Can this be done?
Thankyou
Ed
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro , Unprotect-Protect -- Atten: Tom Ogilvy

Hi Ed

Look in the VBA help for Protect
You can use a password in your code

Worksheets("abc").Protect Password:="password"



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ed" wrote in message ...
Hi Tom
Thankyou for your help on this yesterday.
I put the following in my macro:

(at the start) Worksheets("abc").Unprotect

(at the end) Worksheets("abc").Protect

Basicly this works fine with one major problem.
You can't protect the sheet with a password.
If you do, you have to enter the password befor you can
run the macro. Then the password protection is gone.

What I need is this. After the above macro is run, I
need not only the sheet to be protected but still be
protected with a password. So that only the person that
knows the password can change a cell. That person being me.

Can this be done?
Thankyou
Ed



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro , Unprotect-Protect -- Atten: Tom Ogilvy

Worksheets("abc").Unprotect Password:="ABCD"

Worksheets("abc").Protect Password:="ABCD"

--
Regards,
Tom Ogilvy



"Ed" wrote in message
...
Hi Tom
Thankyou for your help on this yesterday.
I put the following in my macro:

(at the start) Worksheets("abc").Unprotect

(at the end) Worksheets("abc").Protect

Basicly this works fine with one major problem.
You can't protect the sheet with a password.
If you do, you have to enter the password befor you can
run the macro. Then the password protection is gone.

What I need is this. After the above macro is run, I
need not only the sheet to be protected but still be
protected with a password. So that only the person that
knows the password can change a cell. That person being me.

Can this be done?
Thankyou
Ed



  #4   Report Post  
Posted to microsoft.public.excel.programming
ed ed is offline
external usenet poster
 
Posts: 59
Default Macro , Unprotect-Protect -- Atten: Tom Ogilvy

Thanks Tom and Ron
Works Great.
Ed
-----Original Message-----
Worksheets("abc").Unprotect Password:="ABCD"

Worksheets("abc").Protect Password:="ABCD"

--
Regards,
Tom Ogilvy



"Ed" wrote in message
...
Hi Tom
Thankyou for your help on this yesterday.
I put the following in my macro:

(at the start) Worksheets("abc").Unprotect

(at the end) Worksheets("abc").Protect

Basicly this works fine with one major problem.
You can't protect the sheet with a password.
If you do, you have to enter the password befor you can
run the macro. Then the password protection is gone.

What I need is this. After the above macro is run, I
need not only the sheet to be protected but still be
protected with a password. So that only the person that
knows the password can change a cell. That person being me.

Can this be done?
Thankyou
Ed



.

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
Modifying a protect unprotect macro Colin Hayes Excel Discussion (Misc queries) 10 May 1st 11 12:18 AM
Macro to Protect OK, Unprotect now messed up! Stilla Excel Worksheet Functions 12 January 7th 09 02:22 PM
protect / unprotect VBA project by macro sylvain Excel Discussion (Misc queries) 0 July 31st 06 06:09 PM
Unprotect and protect sheet in a macro Ola Sigurdh Excel Programming 1 September 28th 04 11:55 PM
Macro to protect and unprotect tetreaultl Excel Programming 1 April 1st 04 06:16 PM


All times are GMT +1. The time now is 04:09 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"