Technology Get the latest on technology, electronics and software…

Excel Question... Again.

Thread Tools
 
Old Apr 5, 2010 | 05:18 PM
  #1  
stogie1020's Avatar
Thread Starter
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
Excel Question... Again.

I have a workbook with 12 worksheets. Each is identical but named for the month it is to be used in. I restrict what can be done in each sheet and where a user can click, resize, etc. by protecting the sheet.

My problem lies in the fact that when I need to make a change, I need to make it 12 times, and I have to go through each sheet and unprotect, make the change, and the protect again with the password.

Is there an easier way to do this?

Small annoying problem: I have to unprotect each sheet individually and then re-protect them.

Large problem: I have to make 12 identical sheets and adjust each one when I want a change made...
Reply
Old Apr 5, 2010 | 05:37 PM
  #2  
svtmike's Avatar
Team Owner
20 Year Member
Liked
Loved
Community Favorite
 
Joined: Oct 2003
Posts: 37,701
Likes: 3,897
From: Chicago
You can only protect/unprotect sheets one at a time.

To make an identical change in several sheets at a time, select the tabs (through standard click + shift-click or ctrl-click methods) and type the change in once. It will occur in all of the selected worksheets.
Reply
Old Apr 5, 2010 | 05:54 PM
  #3  
stogie1020's Avatar
Thread Starter
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
Thanks. Unfortunately the time consuming task was the un-protecting and re-protecting each sheet...
Reply
Old Apr 5, 2010 | 06:08 PM
  #4  
Pure Adrenaline's Avatar
Dragging knees in
iTrader: (2)
 
Joined: Dec 2002
Posts: 12,434
Likes: 33
From: Seattle Area
This might not work, but...

Delete all sheets except one.
Make changes.
Copy the sheet 11 times.
Rename each sheet for corresponding month.

Would that not work?
Reply
Old Apr 5, 2010 | 06:20 PM
  #5  
Anachostic's Avatar
Safety Car
 
Joined: Jul 2007
Posts: 4,845
Likes: 145
Just because it's you...

Open Excel, Hit Alt-F11, open ThisWorkbook, paste this code in.

To run these, view the macros.

Code:
Sub ProtectEach()
    Dim s As Worksheet
    Dim pw As String
    
    pw = InputBox("Enter password")
    
    For Each s In Me.Worksheets
        s.Protect pw, True, True, True, True, True, True, True, False, False, False, False, False, True, treu, True
    Next
    
    MsgBox "Done."
    
End Sub

Sub UnProtectEach()
    Dim s As Worksheet
    Dim pw As String
    
    pw = InputBox("Enter password")
    
    For Each s In Me.Worksheets
        s.Unprotect pw
    Next
    
    MsgBox "Done."
    
End Sub
Reply
Old Apr 5, 2010 | 07:39 PM
  #6  
#1 STUNNA's Avatar
Sanest Florida Man
Photogenic
Photoriffic
Shutterbug
Community Influencer
 
Joined: Aug 2007
Posts: 45,965
Likes: 11,759
From: Florida
^ he hid a macro virus in white text!

What if you just renamed the spreadsheet once a month?
Reply
Old Apr 5, 2010 | 07:46 PM
  #7  
stogie1020's Avatar
Thread Starter
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
Anachostic, that looks awesome!

Wait, why does it appear to round up the fractions of a penny and put them into your account?
Reply
Old Apr 5, 2010 | 08:05 PM
  #8  
#1 STUNNA's Avatar
Sanest Florida Man
Photogenic
Photoriffic
Shutterbug
Community Influencer
 
Joined: Aug 2007
Posts: 45,965
Likes: 11,759
From: Florida
Didn't they do that in Superman 3?
Reply
Old Apr 6, 2010 | 07:00 AM
  #9  
Whiskers's Avatar
Go Giants
20 Year Member
Liked
Loved
Community Favorite
 
Joined: Aug 2004
Posts: 70,003
Likes: 1,260
From: PA
4?
Reply
Old Apr 6, 2010 | 07:22 AM
  #10  
rza49311's Avatar
Drifting
iTrader: (1)
 
Joined: Feb 2006
Posts: 3,072
Likes: 8
From: Southern VA
I was going to say you could probably make a macro to unprotect the sheets then another to protect the sheets.
Reply
Old Apr 6, 2010 | 11:27 AM
  #11  
Bearcat94's Avatar
AZ Community Team
 
Joined: May 2007
Posts: 32,488
Likes: 7,771
From: N35°03'16.75", W 080°51'0.9"
Originally Posted by Anachostic
Just because it's you...

Open Excel, Hit Alt-F11, open ThisWorkbook, paste this code in.

To run these, view the macros.

....
Brilliant.
Reply
Old Apr 6, 2010 | 12:08 PM
  #12  
MWalsh9152's Avatar
all work and no play
 
Joined: Sep 2006
Posts: 13,916
Likes: 134
From: Wakefield, Ma
if you wrap it up when you bring home the nasties, you wont have to worry about protecting the sheets
Reply
Old Apr 6, 2010 | 12:33 PM
  #13  
GIBSON6594's Avatar
My Garage
 
Joined: Nov 2004
Posts: 13,386
Likes: 11
From: NY
Originally Posted by #1 STUNNA
Didn't they do that in Superman 3?
officespace
Reply
Old Apr 6, 2010 | 01:10 PM
  #14  
johnnysquire's Avatar
Racer
 
Joined: Nov 2007
Posts: 294
Likes: 0
From: West Chester, PA
In the spirit of teaching the OP how to fish - other repetitive tasks can be automated using the "record macro" function under the Tools->Macro menu. The recorded macro will look a lot like the one posted above.
Reply
Old Apr 6, 2010 | 03:22 PM
  #15  
stogie1020's Avatar
Thread Starter
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
Thanks guys, I have experience recording and using macros, but I was concerned about the macro being accessible to the other users, whom I do not want to be able to un-protect the sheet. Every time I keep the macro in my personal workbook, it seems to end up being available to the general masses...
Reply
Old Apr 6, 2010 | 03:33 PM
  #16  
Anachostic's Avatar
Safety Car
 
Joined: Jul 2007
Posts: 4,845
Likes: 145
Originally Posted by stogie1020
Thanks guys, I have experience recording and using macros, but I was concerned about the macro being accessible to the other users, whom I do not want to be able to un-protect the sheet. Every time I keep the macro in my personal workbook, it seems to end up being available to the general masses...
You have to provide the password. The macro is just automating a manual process.
Reply
Old Apr 6, 2010 | 03:40 PM
  #17  
stogie1020's Avatar
Thread Starter
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
Oh, OK. Thanks.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
08_UA7_Gr33k
Member Cars for Sale
13
Feb 11, 2016 02:17 PM
InFaMouSLink
Car Parts for Sale
6
Oct 27, 2015 06:52 PM
xsilverhawkx
2G TL Problems & Fixes
5
Sep 28, 2015 06:51 PM
c1souk
5G TLX (2015-2020)
17
Sep 28, 2015 11:20 AM
08_UA7_Gr33k
Member Cars for Sale
1
Sep 27, 2015 01:56 PM




All times are GMT -5. The time now is 06:42 AM.