Hello TimExcel123,
Welcome to the forum!
This will sort the data in table 1 in descending order using the "Marks" column and then copy the top 3 names to table 2 "A1:A3" on Sheet2. You may need to change the worksheet names in the macro code if your worksheet names aren't the same.
This code needs to be a Standard VBA Module. You can then call this macro manually using the ALT+F8 keys to open the Macro Dialog or call the macro using a button on a worksheet or from other VBA code.
- Copy the macro with Ctrl+C.
- Open the workbook and use Alt+F11 to open the VB Editor.
- Use ALT+I to display the Insert Menu.
- Press the M key to add a new Module.
- Paste the macro into the Module with Ctrl+V.
- Save the macro using Ctrl+S
Bookmarks