Results 1 to 1 of 1

VBA auto sort multicolumn table when data is changed or deleted in protected sheet mode

Threaded View

sahasranama VBA auto sort multicolumn... 04-24-2019, 04:37 AM
  1. #1
    Registered User
    Join Date
    08-14-2012
    Location
    Sofia
    MS-Off Ver
    Excel 2010
    Posts
    4

    VBA auto sort multicolumn table when data is changed or deleted in protected sheet mode

    I use the code to automatically sort the table by attribute "Name" from column B.

    
    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    On Error Resume Next
     If Not Intersect(Target, Range("A:Z")) Is Nothing Then
      Range("B5").Sort Key1:=Range("B6"), _
      Order1:=xlAscending, Header:=xlYes, _
      OrderCustom:=1, MatchCase:=False, _
      Orientation:=xlTopToBottom
     End If
    End Sub

    The first problem with this code is that when I delete a record after the first line remains an empty cell.
    The second problem is how to make the code work while sheet is password-protected.
    Protected password can be found in sheet PASS.

    This is the WeTransfer link to an Excel file: we.tl/t-00zqVQgx82
    Last edited by sahasranama; 04-25-2019 at 01:11 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 03-09-2015, 05:59 AM
  2. [SOLVED] Pictures can not be deleted or changed with sheet protected
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-08-2013, 03:00 AM
  3. [SOLVED] Auto sort on a protected sheet
    By LuisCotera in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-22-2012, 11:42 AM
  4. Data that has been added/changed/deleted between two worksheets
    By frank_france in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-09-2012, 05:55 PM
  5. Replies: 1
    Last Post: 07-19-2011, 02:53 PM
  6. Ability to sort a table when the sheet is protected
    By Cassi in forum Excel General
    Replies: 3
    Last Post: 02-09-2010, 05:20 PM
  7. Data Sort A Protected Sheet
    By marko71 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-17-2008, 10:35 AM

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