PDA

View Full Version : default sort behavior?



tpoynton
10-08-2007, 04:31 PM
Greetings - OK, not a VBA question, but about the Excel sort icon (the little AZ with down arrow)

Dont know if it was some code I opened from here that messed with my settings (arrgh) or something of my own doing (arrgh), but now when I click on that little icon, the default is no longer to include a header row. When I go to Data | Sort, it also never includes a header row. Does anyone know how to set the default behavior to xlGuess (I guess)? Perhaps a registry entry? I've searched via Google and looked in the help and options with no luck...THANKS!

I have become quite accustomed to just clicking on a column letter and then sorting lickity split. I miss it!

YellowLabPro
10-09-2007, 04:55 AM
Tim,
Can you post a sheet for an example?

tpoynton
10-09-2007, 05:44 AM
Hi Doug - sorry I wasnt clear; this is a problem with my local Excel 2003 installation. I suspect it happened when I opened a sheet here that had code that disabled/removed the sort icon from the toolbar...I was able to get it back via a command in the immediate window, but how to get back the default functionality has me stumped!

YellowLabPro
10-09-2007, 06:07 AM
Tim,
I just wanted to test the same sheet you were having difficulty so we could compare apples. For instance, if your sort box was always defaulting to No Header Row, or what you were experiencing.
One thing that you might check if you ran a macro that told it No header Rows, this may keep the setting that way in Excel. I went through somehting similar w/ the Find feature in Excel. It is a real joy to deal w/ :stars:

tpoynton
10-09-2007, 06:32 AM
Thanks Doug - I'll see what I can figure out...here's the thing; most of what i do in VBA is with add-ins. when I am working with an Excel workbook, there are almost always no macros, so it's not workbook specific - it happens in every workbook I open, and none have code.

I have tried several files, ones I know have no code and previously worked, so i'll save some bandwidth by not posting a sample (seems like saving bandwidth is needed today!)

I'll play around with the immediate window, and try to dig up the offending code.

YellowLabPro
10-09-2007, 06:41 AM
Tim,
My point was that if some code, and could be caused from an Add-in has set the Sort Box to select the option No Header, and Excel retains this setting, you may possibly rectify this w/ a macro that sets it back. Does that make sense? Am I completely off track?

tpoynton
10-09-2007, 06:48 AM
Doug - you are very likely on track, but the problem is finding the specific bit of code and it's location. I'm pretty confident it is not my add-in, and there is just too much code in it to post. I use the add-in on several computers, and the problem only affects one. I'll play around with things...

YellowLabPro
10-09-2007, 07:07 AM
Ok, Right. I don't need/want you to post your code. Just upload a sheet that you have been using that will not sort on headers. That way I can look for a couple of other things that might be causing it.

My other idea is write our own code like this:

Selection.Sort Key1:=Range("AE2"), Order1:=xlAscending, Key2:=Range("AF2" _
), Order2:=xlAscending, Key3:=Range("AG2"), Order3:=xlAscending, Header _
:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom _
, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _
xlSortNormal

Run this and see if this sets the option to Headers back on your next sort.

tpoynton
10-09-2007, 07:56 AM
I'm an idiot. seemed like every file I opened lately had this problem. tried an older file, and it works fine with normal behavior. Turns out all the files I was working with were created from the same template, so there's something amiss on it. I cant post the info right now; i'll try to remove sensitive info and post later. Thanks Doug for pushing the issue...it was much more a user problem than an Excel problem...

YellowLabPro
10-09-2007, 08:07 AM
Good, Glad you got it sorted. I know what it is like to look for those little buggers....

tpoynton
10-09-2007, 05:02 PM
Good, Glad you got it sorted.

ha ha...got it sorted

havent had time to figure it out yet; if/when I do, I'll mark as solved