Share via

macro does not do sort on active sheet

Anonymous
2018-02-25T10:26:37+00:00

In excel, I cannot get the macro to do a custom sort for the active sheet. It just does it again on the first sheet. My menu bar in excel developer says I have got "Use Relative References", and it has been suggested this is causing this problem. I don't want "Relative References". How can I disable it?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

14 answers

Sort by: Most helpful
  1. Anonymous
    2018-02-25T14:57:13+00:00

    That toggle button Is NOT available on 365 MAC!!!!  I've been complaining for months!!!

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2018-02-25T13:34:02+00:00

    Richard,

    re:  wrong sheet used

     Or...

    Your code should be in a standard module, not the module attached to a worksheet?

    '---

    Jim Cone

    https://goo.gl/IUQUN2

    https://goo.gl/IUQUN2

    Was this answer helpful?

    0 comments No comments
  3. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2018-02-25T11:39:19+00:00

    Developer tab, section Code:

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2018-02-25T11:24:18+00:00

    Thank you. I would like to try using that toggle button but I do not know what or where it is. Can you tell me how to get to it?

    Was this answer helpful?

    0 comments No comments
  5. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2018-02-25T11:05:29+00:00

    Click the "Use Relative References" toggle button to switch on or off.

    But that did not solve the issue, because absolute means

        Range("A1").Select

    and relative means

        ActiveCell.Offset(-2, -1).Range("A1").Select

    if you start from B3.

    And both are bad. Please never use SELECT, SELECTION, ACTIVECELL, it is slow and error prone. Always refer to the objects directly.

    Post the code you have, then we'll see.

    Andreas.

    Was this answer helpful?

    0 comments No comments