Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default lock a cell from users but not macros

I have a work sheet my macro copys data into. When i just protect the sheet
the macro will not run. Is there a way to lock it so the macro will still
work but the users can not edit the data.

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default lock a cell from users but not macros

Hi

Unprotect the sheet at the top of the macro and then re-protect at the end.

Regards,
Per

"Miree" skrev i meddelelsen
...
I have a work sheet my macro copys data into. When i just protect the
sheet
the macro will not run. Is there a way to lock it so the macro will still
work but the users can not edit the data.

Thank you


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default lock a cell from users but not macros

Is there a way to get this to work with a password? when i tried to do it
with password it needed a user input, to unprotect, i dont want my users to
have the password. Also it doesn't lock with a pass word

"Per Jessen" wrote:

Hi

Unprotect the sheet at the top of the macro and then re-protect at the end.

Regards,
Per

"Miree" skrev i meddelelsen
...
I have a work sheet my macro copys data into. When i just protect the
sheet
the macro will not run. Is there a way to lock it so the macro will still
work but the users can not edit the data.

Thank you



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default lock a cell from users but not macros

Try this

ActiveSheet.Unprotect Password:="MyPass"
' do things
ActiveSheet.Protect Password:="MyPass"

Mike

"Miree" wrote:

Is there a way to get this to work with a password? when i tried to do it
with password it needed a user input, to unprotect, i dont want my users to
have the password. Also it doesn't lock with a pass word

"Per Jessen" wrote:

Hi

Unprotect the sheet at the top of the macro and then re-protect at the end.

Regards,
Per

"Miree" skrev i meddelelsen
...
I have a work sheet my macro copys data into. When i just protect the
sheet
the macro will not run. Is there a way to lock it so the macro will still
work but the users can not edit the data.

Thank you



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default lock a cell from users but not macros

Perfect thank you

"Mike H" wrote:

Try this

ActiveSheet.Unprotect Password:="MyPass"
' do things
ActiveSheet.Protect Password:="MyPass"

Mike

"Miree" wrote:

Is there a way to get this to work with a password? when i tried to do it
with password it needed a user input, to unprotect, i dont want my users to
have the password. Also it doesn't lock with a pass word

"Per Jessen" wrote:

Hi

Unprotect the sheet at the top of the macro and then re-protect at the end.

Regards,
Per

"Miree" skrev i meddelelsen
...
I have a work sheet my macro copys data into. When i just protect the
sheet
the macro will not run. Is there a way to lock it so the macro will still
work but the users can not edit the data.

Thank you




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default lock a cell from users but not macros

Use this syntax:

ActiveWorkbook.Unprotect Password:="JustMe"
ActiveWorkbook.Protect Password:="JustMe"

Regards,
Per

"Miree" skrev i meddelelsen
...
Is there a way to get this to work with a password? when i tried to do it
with password it needed a user input, to unprotect, i dont want my users
to
have the password. Also it doesn't lock with a pass word

"Per Jessen" wrote:

Hi

Unprotect the sheet at the top of the macro and then re-protect at the
end.

Regards,
Per

"Miree" skrev i meddelelsen
...
I have a work sheet my macro copys data into. When i just protect the
sheet
the macro will not run. Is there a way to lock it so the macro will
still
work but the users can not edit the data.

Thank you




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
Other users of my Excel VBA macros Ed[_31_] Excel Programming 11 May 29th 07 01:16 PM
How do I lock a worksheet while allowing users to add comments? Kidspirit Excel Discussion (Misc queries) 1 December 1st 05 12:22 AM
macros for end users [email protected] Excel Programming 3 May 30th 05 10:53 PM
how do I import macros from other users Jim Neal Excel Programming 1 February 11th 05 03:33 PM
Hide Macros from Users Larry Graff Excel Programming 2 September 10th 03 05:41 PM


All times are GMT +1. The time now is 08:53 AM.

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"