ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   merging cells in a protected work sheet (https://www.excelbanter.com/excel-discussion-misc-queries/114395-merging-cells-protected-work-sheet.html)

EG

merging cells in a protected work sheet
 
is it possible to merge cells in a protected worksheet?

Eric

Dave Peterson

merging cells in a protected work sheet
 
It sure doesn't look like it's possible to me.

Can you provide a macro that unprotects, merges, and reprotects?



EG wrote:

is it possible to merge cells in a protected worksheet?

Eric


--

Dave Peterson

Robert McCurdy

merging cells in a protected work sheet
 
There was this guy in India who rolled across the continent on his back.
Using merged cells is like that - you can but for Gods sake WHY?!

activesheet.protect Password:="", UserInterfaceOnly:=True
'code to merge

In case you change your mind ;)
Code to unmerge - [B2:D4].UnMerge


Regards
Robert McCurdy

"EG" wrote in message ...
is it possible to merge cells in a protected worksheet?

Eric

EG

merging cells in a protected work sheet
 
Thanks, Robert. I have a spread sheet that i have some fairly complex
functions in one part of it, which i want to protect from being changed. in
the other part of the sheet i want people to be able to manipulate and merge
cells as they need to. Do i need to select the cells i want people to be
able to change and then type: :
="", UserInterfaceOnly:=True ??

Thanks for your help!

Eric


"Robert McCurdy" wrote:

There was this guy in India who rolled across the continent on his back.
Using merged cells is like that - you can but for Gods sake WHY?!

activesheet.protect Password:="", UserInterfaceOnly:=True
'code to merge

In case you change your mind ;)
Code to unmerge - [B2:D4].UnMerge


Regards
Robert McCurdy

"EG" wrote in message ...
is it possible to merge cells in a protected worksheet?

Eric


Robert McCurdy

merging cells in a protected work sheet
 
Try this with the sheet unprotected.
Select all the cells (ctrl + A), Ctrl + 1 pick the protection tab and uncheck the Locked check box OK.
Now select the cells you want to protect, and repeat the above but this time tick the Locked check box.
Go to Tools Macro Record New Macro..., Name it say ProtectMySheet, the defaults should be ok to store in This Workbook. OK.
Now protect the sheet as you would normally.
Stop recording.

To get to see the code type the macro name into the Name box - far left of the formula bar, then press enter. Something like below is what you should see.


Sub ProtectMySheet()
'
' ProtectMySheet Macro
' Macro recorded 15/10/2006 by EG

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

Now just edit the above to look like this:

Sub ProtectMySheet()
' the commented bits here can be safely removed
' ProtectMySheet Macro
' Macro recorded 15/10/2006 by EG

ActiveSheet.Protect Password:="Yourpassword", UserInterfaceOnly:=True _
DrawingObjects:=True, Contents:=True, Scenarios:=True,

End Sub

Another piece of code to unprotect the sheet is: Activesheet.unprotect "Yourpassword"
Which you can have in another macro. You can assign these macros to objects, buttons or Events - check out the Help files on this.

To answer - rather belatedly - your original question: Not unless you wish to provide the sheets password to all users. The above works only when the changes are made using VBA.
So in your case you'd need to provide a different GUI with code (Userforms, etc).
There are other options, all involve using VBA in some way.


Regards
Robert McCurdy

"EG" wrote in message ...
Thanks, Robert. I have a spread sheet that i have some fairly complex
functions in one part of it, which i want to protect from being changed. in
the other part of the sheet i want people to be able to manipulate and merge
cells as they need to. Do i need to select the cells i want people to be
able to change and then type: :
="", UserInterfaceOnly:=True ??

Thanks for your help!

Eric


"Robert McCurdy" wrote:

There was this guy in India who rolled across the continent on his back.
Using merged cells is like that - you can but for Gods sake WHY?!

activesheet.protect Password:="", UserInterfaceOnly:=True
'code to merge

In case you change your mind ;)
Code to unmerge - [B2:D4].UnMerge


Regards
Robert McCurdy

"EG" wrote in message ...
is it possible to merge cells in a protected worksheet?

Eric



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com