+ Reply to Thread
Results 1 to 2 of 2

Excel blocking cells with macro - in need of Autofilter

  1. #1
    Registered User
    Join Date
    12-02-2016
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    1

    Excel blocking cells with macro - in need of Autofilter

    Hello,

    I am looking for an adjustment or solution for my macro in Excel.

    This macro blocks cells once they are filled in by a user. We do this to protect the filled in values.

    Code:

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim cel As Range
    ActiveSheet.Unprotect ' Password:="xxx"
    For Each cel In Target
    If cel.Value <> "" Then
    cel.Locked = True
    End If
    Next cel
    ActiveSheet.Protect ' Password:="xxx"
    End Sub


    Problem:

    Once a cell is filled in and blocked, the autofilter of the first column of my worksheet is also blocked.
    We definitely need this Autofilter, the file contains over 15 000 rows ..

    The setting for "Allow users to use Autofilter" doesn't work because the macro overwrides this setting every time.

    Is there a way to still use an Autofilter on blocked cells?
    Or a way to indicate that a specifief column never gets blocked?

    Thank you in advance!

    Kind regards,
    Leysens

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Excel blocking cells with macro - in need of Autofilter

    When you re-protect the sheet, set the AllowFiltering argument to True.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Blocking cells
    By Selo in forum Excel General
    Replies: 5
    Last Post: 04-22-2007, 05:07 PM
  2. [SOLVED] blocking cells
    By Mangesh Yadav in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 05:05 PM
  3. blocking cells
    By confused of nottingham in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  4. [SOLVED] blocking cells
    By confused of nottingham in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  5. [SOLVED] blocking cells
    By confused of nottingham in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 AM
  6. blocking cells
    By confused of nottingham in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  7. blocking cells
    By confused of nottingham in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  8. [SOLVED] Non-blocking calls to Excel Macro using OLE Automation
    By BW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-03-2005, 05:05 PM

Tags for this Thread

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