Dynamic Range Sort

lapta301

Well-known Member
Joined
Nov 12, 2004
Messages
1,001
Office Version
  1. 365
Platform
  1. Windows
Dear All

I have a range of data including headings that currently extends from B3 to I73 but this may grow.

I would like a piece of code that I will attach to a button which when selected will ask the user if the sort is to be "YTD" or "Current Month". I suppose there will also be a need to cancel if they change their mind

If the "YTD" option is selected then the sort is on a field "Rank on YTD" and if "Current Month" then the sort field is "Rank on this Month".

I appreciate that this is relatively straight forward but I need to cover the fact that the rows and columns may extend.

As always many thanks for any help that you can provide.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
lapta301,

If the "YTD" option is selected then the sort is on a field "Rank on YTD" and if "Current Month" then the sort field is "Rank on this Month".

In row 3, your headings extend from B3 to I73 (but this may grow).

What column are the headings in?
"Rank on YTD"
"Rank on this Month"

Sorting ascending or descending?

And, what column always has data in it?


Please post a screenshot of your sheet(s), what you have and what you expect to achieve, with Excel Jeanie HTML 4.
http://www.excel-jeanie-html.de/html/hlp_schnell_en.php



Have a great day,
Stan
 
Last edited:
Upvote 0
Stanley

They are currently in H & I respectively but this will probably change.

Is it possible to identify the columns by the name which I could ensure doesn't change?

The actual data range without headings is B4 to I73 and the sort order is ascending.

There will usually be data in all columns but for the sake of an absolute, there will always be something in column B.
 
Upvote 0
Upvote 0
Stanley

I'm having a good look at what I am doing and how to make life easier all round so give me a day or so and I'll get back to you.

Many thanks


lapta301
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,497
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top