You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Numbers: key combination (or script) to move items in a pop-up menu

What I want to do: I want to re-arrange the order of items in a pop-up menu (cell formatting) in Numbers without dragging them with the mouse/trackpad. So how do I move an item in the list of a pop-up menu using a key combination and/or Applescript?

Where I want to this: Numbers -> Cell formatting (inspector side panel) -> pop-up menu -> scroll area.


Please let me if you have a solution.


P.s.: I have a few work-arounds … but they are still “work-arounds”. And if it’s not possible then please let me know as well.

MacBook Pro 16″, macOS 14.7

Posted on Nov 12, 2024 3:14 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 12, 2024 6:21 AM

Here is the best way I have found to deal with pop up menus:


Creating a pop up menu from a column of data:

  1. Create a column of items for the pop up menu
  2. Select all of them. If a blank cell is included, the pop up menu will naturally be "start with blank".
  3. Format as pop up menu.  All of the cells will be pop up menus that include all the items in the order they appear in the table
  4. Select one of them (probably the blank or first one)
  5. Copy
  6. Paste it to where it is needed


How to edit the pop up menu and update all of the pop up menus used/present in another table (assuming they are in a column of the other table):

  1. In the table for creating the pop up, select the column of items  
  2. Format as text or as whatever format of the items should be
  3. Edit the items (add new items, delete items, sort, etc.)
  4. Select them and format as pop up
  5. Copy the popup that matches the uppermost one in the other table.
  6. Paste the new pop up over the old one.
  7. In this other table, select that cell and the rest of the column of pop ups.
  8. In the cell tab of the format sidebar, choose to merge menu items. All cells will get all the new items and they will be in the same sort order as the newly created pop up. If a cell was set to an item that was deleted for the new pop up, it will go to the bottom of the pop up menu for that cell. That pop up will be different from the others.



When written out it is a lot of steps but it isn't all that difficult to do unless you use the pop up in random cells (not a contiguous column or row of cells) or in a lot of different tables.

4 replies
Question marked as Top-ranking reply

Nov 12, 2024 6:21 AM in response to theodekreijger

Here is the best way I have found to deal with pop up menus:


Creating a pop up menu from a column of data:

  1. Create a column of items for the pop up menu
  2. Select all of them. If a blank cell is included, the pop up menu will naturally be "start with blank".
  3. Format as pop up menu.  All of the cells will be pop up menus that include all the items in the order they appear in the table
  4. Select one of them (probably the blank or first one)
  5. Copy
  6. Paste it to where it is needed


How to edit the pop up menu and update all of the pop up menus used/present in another table (assuming they are in a column of the other table):

  1. In the table for creating the pop up, select the column of items  
  2. Format as text or as whatever format of the items should be
  3. Edit the items (add new items, delete items, sort, etc.)
  4. Select them and format as pop up
  5. Copy the popup that matches the uppermost one in the other table.
  6. Paste the new pop up over the old one.
  7. In this other table, select that cell and the rest of the column of pop ups.
  8. In the cell tab of the format sidebar, choose to merge menu items. All cells will get all the new items and they will be in the same sort order as the newly created pop up. If a cell was set to an item that was deleted for the new pop up, it will go to the bottom of the pop up menu for that cell. That pop up will be different from the others.



When written out it is a lot of steps but it isn't all that difficult to do unless you use the pop up in random cells (not a contiguous column or row of cells) or in a lot of different tables.

Nov 16, 2024 3:25 AM in response to Badunit

Hi Badunit,


I got it all working with an Applescript Shortcut. Thanks to your tip. :)


But Copy & Paste sadly does not work anymore in a MacOS Shortcut (bug?). So I use an {array} filled with values from a column on another worksheet to overwrite the current items in the pop-up menu of the first cell of the column and add extra rows for the remaining ones. I then put the original value in the first cell back again (which was gone) followed by your "merge trick" which worked perfectly with the range of the rest of the column.


Some findings using Applescript:

  • Selecting non-adjacent cells/ranges cannot be done.
  • Copy (tell application "System Events" to keystroke "c" using command down) and Paste (same with "v") does not work in Shortcuts.
  • You cannot clear out a pop-up menu of a cell range without removing all the cell contents (values) as well.
  • There must be one item in a pop-up menu, so you cannot delete the last item.
  • Selecting a pop-menu item in the cell formatting panel is possible, but doesn't get the "focus".
  • You cannot replace the contents of a pop-menu with an {array} in one go. You have to go through the items (rows) one by one.
  • Addressing buttons, scroll areas, checkmarks and other items in the "formatting" panel is a nightmare. Is it "button 1" or "button 2" ? And why "scroll area 1" followed by "scroll area -1" ? It's not documented and becomes a lot of guesswork. In particular in foreign versions of Numbers when something like "radio button Cell" does not work at all.


It all looks like Applescript was a rush job done by programmers who think like programmers but not like users. Sadly a common mistake. Perhaps Apple will give this some more attention in the future?


Best,


Theo

Numbers: key combination (or script) to move items in a pop-up menu

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.