+ Reply to Thread
Results 1 to 6 of 6

How to lock cells from excel sort function

  1. #1
    Registered User
    Join Date
    07-05-2009
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    61

    How to lock cells from excel sort function

    Hey,

    I have a table in which the first row of cells are headings for each column and can sort data from all the columns. On the second row are the totals of all the columns with formulas.

    Every time i sort the table the totals row gets sorted with all the other data messing up the table.

    Is there anyway to lock or protect a row from the sort function in excel?

    Thank you for your time

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to lock cells from excel sort function

    dont sort the first 2 rows!
    select from row 3 down and sort with no header row
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    07-05-2009
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    61

    Re: How to lock cells from excel sort function

    Quote Originally Posted by martindwilson View Post
    dont sort the first 2 rows!
    select from row 3 down and sort with no header row
    Thanks.

    That does work

    Although not exactly what i was looking for. Is there really no way to completely lock a row of cells from use (without using sheet protection)?

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to lock cells from excel sort function

    record a macro doing the sort as i said then assign it to a button. then you only have to click button to do sort.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,600

    Re: How to lock cells from excel sort function

    If the calculated totals are not used elsewhere, you can use a formula in row one cells to combine the header string and the totals. E.g., given:

    A1: MyHeader
    A2: =SUM(MyRange)
    .
    .
    Try:
    A1: ="MyHeader xTotal is: " & SUM(MyRange)

    Note that the "x" indicates where you would press Alt-Enter to force a new line for the total string. That way you can eliminate the current A2:.... rows
    Ben Van Johnson

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to lock cells from excel sort function

    i like that!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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