+ Reply to Thread
Results 1 to 1 of 1

Recording macro doesn't expand selection while sorting [Office Script]

  1. #1
    Registered User
    Join Date
    10-19-2023
    Location
    Netherlands
    MS-Off Ver
    2309
    Posts
    3

    Recording macro doesn't expand selection while sorting [Office Script]

    Hi all!
    I have an excel file with the answers to several questions given by students in columns next to their student numbers.
    The goal is to divide them into teams of maximum 7 people, and using their answers to the questions to create the teams as diversely as possible.

    As approach I sort the columns with answers from A to Z, starting with the least important answers (column D), and ending with the most important answers (column F).
    Each time I sort, I select "expand selection" in the user interface window that pops up.
    I then calculate the amount of groups by using the amount of rows, dividing it by 7, and rounding up.
    Then, I give the student team numbers, copy past the team numbers so the team numbers are seen as text instead of formulas, and then sort the students based on team numbers.

    However, it doesn't seem to work. I think this is because the recorder doesn't take the user interaction for the expansion of the selection.
    Furthermore, the copy pasting of column H doesn't seem to work very well.

    Attached you can find the code I have recorded as described above, and a trial excel file.
    Any help or comments is very much appreciated, thanks in advance!
    Attached Files Attached Files
    Last edited by 6StringJazzer; 10-30-2023 at 09:54 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. doing Selection.Clear but by recording Macro only
    By lastnn30 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2021, 10:27 PM
  2. Recording a macro that includes conditional formatting doesn't work
    By Jtec75 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-18-2020, 05:17 AM
  3. Expand Selection for Custom Sorting
    By jhuang5132 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-11-2014, 12:16 PM
  4. Replies: 0
    Last Post: 07-07-2013, 01:50 AM
  5. Recording a filter which then doesn't work.
    By Peter Rooney in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-03-2005, 12:10 PM
  6. Recording new excel macro, relative reference button doesn't show
    By Dano in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 08-23-2005, 03:05 PM
  7. Macro doesn't work but recording it does.
    By Rob in forum Excel General
    Replies: 4
    Last Post: 05-24-2005, 06:32 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1