Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I use a particular spreadsheet everyday, and sort the data in three columns
of the worksheet many times (there is also other data that I do not sort). I don't have a header row. Until recently, the spreadsheet seemed to know how I wanted to sort, and the 'sort by' box always appeared with the sort by defaulting to my previous criteria, seemingly remembering how I had sorted it last time. Recently something has happened, and every time I go to sort, first the dialogue box comes up showing a header row, and when I change it to show no header row, EACH time it defaults to "sort by column A", even though I always sort this worksheet by columns B, C, and D. So now I have extra steps to direct the sheet to sort by B-C-D everytime I want to sort. Is there a setting somewhere, or was I just lucky before? |
#2
![]() |
|||
|
|||
![]()
If you select your range and call this routine, the sort dialog box will appear with your prefered settings as the default. You can change the settings before you choose to sort.
Code:
Sub SortWithDefaults() Dim xval As Variant xval = Application.Dialogs(xlDialogSort).Show(xlTopToBottom, _ Range("b1"), xlAscending, _ Range("c1"), xlAscending, _ Range("d1"), xlAscending, xlYes, 1, False) End Sub Quote:
|
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks - now I'm really going to show my ignorance. What do I do with the
code you provided? Is it a macro? The problem self corrected briefly when I changed the first item in row A to something else (it had been in the A1 position for a long time). But after a while it went back to default sort with a header row, which I never do with this sheet. Seems like it has a mind of its own. Thanks again. "mikerickson" wrote: If you select your range and call this routine, the sort dialog box will appear with your prefered settings as the default. You can change the settings before you choose to sort. Code: -------------------- Sub SortWithDefaults() Dim xval As Variant xval = Application.Dialogs(xlDialogSort).Show(xlTopToBott om, _ Range("b1"), xlAscending, _ Range("c1"), xlAscending, _ Range("d1"), xlAscending, xlYes, 1, False) End Sub -------------------- MarkCA;509991 Wrote: I use a particular spreadsheet everyday, and sort the data in three columns of the worksheet many times (there is also other data that I do not sort). I don't have a header row. Until recently, the spreadsheet seemed to know how I wanted to sort, and the 'sort by' box always appeared with the sort by defaulting to my previous criteria, seemingly remembering how I had sorted it last time. Recently something has happened, and every time I go to sort, first the dialogue box comes up showing a header row, and when I change it to show no header row, EACH time it defaults to "sort by column A", even though I always sort this worksheet by columns B, C, and D. So now I have extra steps to direct the sheet to sort by B-C-D everytime I want to sort. Is there a setting somewhere, or was I just lucky before? -- mikerickson |
#4
![]() |
|||
|
|||
![]()
It doesn't have a mind of its own, it just thinks you want it to be helpful rather than consistant.
Yes that is a macro. To put it in your workbook, goto Tools-Macro-Visual Basic Editior Insert a Module (not a class Module) Copy the code from your web browser to the window. Close the VB editor. Use Excel's help system (keyword:=macro) to assign the routine to a button. Quote:
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sorting Spreadsheet Selection - Recurring Sort | Excel Worksheet Functions | |||
Identifying a selection of a selection of a range | Excel Worksheet Functions | |||
sorting data and expanding the selection | Excel Discussion (Misc queries) | |||
Changing Selection for the "Center Across Selection" alignment | Excel Discussion (Misc queries) | |||
why does sorting large columns create errors in top selection? | Excel Worksheet Functions |