When a range is selected next to other filled cells and a Sort command is
launched, an alert appears asking to expand the selection to the current
region or continue with the selected range. I appreciate this safeguard for
beginners, but I would rather disable it. I've found no such option, so
tried making new Sort buttons that included code to cancel the alert:
Application.DisplayAlerts = False
Selection.Sort Key1:=Range(ActiveCell.Address), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Yet the alert still appears. Is what I want possible, or is my code wrong?
Thanks for your time and help.