Results 1 to 8 of 8

Format all cells in all sheets to Protection Hidden on visible and hidden tabs

Threaded View

DeRo22 Format all cells in all... 02-28-2014, 12:07 PM
alansidman Re: Format all cells in all... 02-28-2014, 12:19 PM
DeRo22 Re: Format all cells in all... 02-28-2014, 12:22 PM
alansidman Re: Format all cells in all... 02-28-2014, 12:58 PM
DeRo22 Re: Format all cells in all... 02-28-2014, 01:05 PM
alansidman Re: Format all cells in all... 02-28-2014, 02:38 PM
DeRo22 Re: Format all cells in all... 02-28-2014, 02:58 PM
alansidman Re: Format all cells in all... 02-28-2014, 03:17 PM
  1. #1
    Registered User
    Join Date
    04-04-2013
    Location
    Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    15

    Format all cells in all sheets to Protection Hidden on visible and hidden tabs

    Hello,

    I am a novice at VBA programming, I have this VBA that I have build through some trial and error and via some web searching. I am trying to format all cells on all sheets (hidden or otherwise) as "Locked" so when the sheets are protected the user can't see the formulas. This macro individually selects every sheet in the book and applys the formatting. Is there a way to modify this code to accomplish the same thing without having it actually select every sheet? The only reason it is an issue is that after running the macro you end up on the last sheet in the book. I don't want it to actually move anyone anywhere and I feel there is probably a more efficient way for this to run.

    Thanks!

    Sub LockAllCells()
    Application.ScreenUpdating = False
    Dim wsheet As Worksheet
    For Each wsheet In ActiveWorkbook.Sheets
        wsheet.Activate
        Cells.Locked = True
        Cells.FormulaHidden = True
        Next wsheet
    End Sub
    Last edited by alansidman; 02-28-2014 at 12:19 PM. Reason: code tags added

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 01-06-2014, 02:14 AM
  2. [SOLVED] trying to access the excel sheets/Tabs in the hidden/very hidden mode through hyperlinks
    By Kiran Kurapati in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-30-2013, 06:50 AM
  3. Making sheets visible or hidden based on value of a range of cells.
    By alzhander in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2012, 09:12 AM
  4. Protection and hidden sheets
    By daddioja in forum Excel General
    Replies: 1
    Last Post: 02-15-2007, 10:03 PM
  5. Making sheets visible / hidden
    By Xlyr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-06-2005, 04:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1