deactivating sort warnings

T

Troy

I am using Excel 2002 and trying to sort a single column
with text in a column next to the original column. When I
do it pops up a warning that reads "Microsoft Excel found
data next to your selection. Since you have not selected
this data, it will not be sorted. What do you want to do?
Expand the selection or continue with the current
selsction." Can I turn this warning off? If so, how do I
turn it off?
 
D

Dave Peterson

I don't think so. In fact, it took a long time to get this added.

But if you really want to, you could record a macro when you do it. Excel won't
bug you if it figures your code knows what it's doing.

Option Explicit
Sub test()
With Selection
If .Cells.Count < 2 Then
MsgBox "Please select a nicer range"
Else
.Sort key1:=.Cells(1, 1), order1:=xlAscending, header:=xlNo
End If
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top