Looking for Macro to sort sheets

bloubul

Member
Hi All.

I got a workbook containing 16 different spreadsheets.
I want to know if 2 macro’s can be created to sort 11 spreadsheets up and down.
I’ve been on the Internet for days, but no luck.
The 11 spreadsheets are named as follows: 3 Draws, 4 Draws, 5 Draws, 6 Draws, 10 Draws, 17 Draws,
20 Draws, 35 Draws, 50 Draws, 75 Draws and 100 Draws.
It must sort all “Draws” according column “B” from the highest value to the lowest,
as values are allocated to column “B”. The sheets named “Draws” starts as follows.

1. 3 Draws starts in columns A6:B50
2. 4 & 5 Draws starts in columns A7:B51
3. 6 to 100 Draws starts in columns A8:B52.

Once that’s done and dusted the second macro must sort it back in column “A” as indicated back from 1 to 45, and “Clear” all values in column “B”


BlouBul :cool:
 

Frank

Member
Bloubul, the actions you require lend themselves easily to being recorded. Have you ever recorded a macro? Provided you have first rehearsed doing everything you describe without mistakes, record the process in two sessions and you will end up with 2 macros.
Get yourself set up ready to start, click on the developer tab, select ' record macro' give the macro a name. Then off you go, methodically selecting each page in turn, each table in turn and sorting to your specification. After completing all pages, go back to the developer tab and click on 'stop recording'. Your first macro is made!
Prepare yourself for the next stage, ( sorting by column A and clearing columns B).
Go to developer tab, click on record macro, and off you go.,.
When finished, go to developer tab and click on ' stop recording'.

I'm surprised nobody on the internet suggested this, it's exactly what ' record macro' was designed for.

By giving you this advice I'm not suggesting I wouldn't help you by writing your macros, and indeed someone else may volunteer, but it's quicker and easier to record a macro for these tasks, that's all I'm saying. :spiny: in fact if I were doing this for myself, I would record a macro - life's too short to stuff a mushroom!
 

Frank

Member
Very good. Recorded macros can be edited afterwards to improve them. For example, you may wish to make the process of changing sheets and sorting invisible. This can be achieved by adding Screenupdating= False as the first line of each macro after the macro name, and adding Screenupdating= True as the last line before the end sub in each case.
You may wish to link each macro to a button for convenience too.
Good Luck!
 

Sidebar

Top