Dynamic Range Sort

lapta301

Well-known Member
Joined
Nov 12, 2004
Messages
991
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.
 

Some videos you may like

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Joined
Jul 30, 2006
Messages
3,656
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:

lapta301

Well-known Member
Joined
Nov 12, 2004
Messages
991
Office Version
  1. 365
Platform
  1. Windows
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.
 
Joined
Jul 30, 2006
Messages
3,656

lapta301

Well-known Member
Joined
Nov 12, 2004
Messages
991
Office Version
  1. 365
Platform
  1. Windows
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
 

Watch MrExcel Video

Forum statistics

Threads
1,123,384
Messages
5,601,320
Members
414,442
Latest member
Oleg

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
Top