+ Reply to Thread
Results 1 to 3 of 3

How to allow alphabetical sorting in VBA code

  1. #1
    Registered User
    Join Date
    09-09-2020
    Location
    Ohio, USA
    MS-Off Ver
    Version 1908
    Posts
    35

    How to allow alphabetical sorting in VBA code

    I am trying to make it so when my workbook opens, it protects the sheet, while allowing for filtering and sorting. The filtering works fine, but when I try to sort my list alphabetically, it doesn't work. The information on my sheet is for my company, so I can't share it, but I think my answer should be pretty simple. The following is the line of code I'm using for my function:

    Sheets("Technicians").Protect Password:="3.14159", AllowSorting:=True, AllowFiltering:=True

    Is AllowSorting not used to allow alphabetical sorting? I'm not sure where I'm going wrong

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: How to allow alphabetical sorting in VBA code

    You cannot sort data on a protected sheet, if any cells within the sort range are locked.

  3. #3
    Forum Contributor
    Join Date
    08-26-2016
    Location
    UK
    MS-Off Ver
    O365
    Posts
    260

    Re: How to allow alphabetical sorting in VBA code

    regarding allowing sorting, Microsoft says: Users can't sort ranges that contain locked cells on a protected worksheet, regardless of this setting.
    so if you haven't unlocked al the table's cells, including headers, you won't be able to sort.
    edit post posting: Oops, too late.

+ 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. [SOLVED] Formula for Sorting in alphabetical order
    By Neilesh Kumar in forum Excel General
    Replies: 4
    Last Post: 11-05-2017, 08:51 AM
  2. Data Sorting by Month (Not Alphabetical)
    By FranAgrippina in forum Excel General
    Replies: 10
    Last Post: 08-05-2015, 01:05 PM
  3. Sorting a table into alphabetical order?
    By elliottt in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-21-2014, 12:57 PM
  4. Automatically sorting in to alphabetical order
    By macky18 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-15-2013, 07:45 AM
  5. Numbering Files for Alphabetical Sorting
    By CrazyFileMaker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2010, 08:20 PM
  6. [SOLVED] Sorting Colums into alphabetical order
    By tox in forum Excel General
    Replies: 3
    Last Post: 02-22-2005, 12:06 PM
  7. Sorting rows into alphabetical order?
    By tox in forum Excel General
    Replies: 8
    Last Post: 02-04-2005, 07:08 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