Benches Uncategorized

10

how do I insert new table between several…

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I have a Numbers sheet which contains several tables each represents one stock holding. I prefer to keep the tables in alphabetical order by stock symbol. The tables are organized vertically with about 1/2 inch between tables.

how do I add a new table between existing tables to maintain the alphabetical order?

Bill

10 replies

Sign in or join Beachball Help to reply.

  1. 0

    SGIII

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Select the tables below where you want the new table (just click the canvas, hold the mouse down, and drag to include the tables) and drag them down lower.

    Add the new table and drag it to the place where you want it.

    SG

  2. 0

    SGIII

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    There is probably a way to script the arrangement of the tables.

    But if you're keeping like data in all the tables, why not just combine them into one table> That way your data will be easy to sort alphabetically. And whenever you want to see a particular stock just apply a filter. Or use Categories (Organize menu) to let Numbers organize them for you.

    SG

  3. 0

    SGIII

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Select the tables below where you want the new table (just click the canvas, hold the mouse down, and drag to include the tables) and drag them down lower.

    Add the new table and drag it to the place where you want it.

    SG

  4. 0

    Bill3

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thanks. I was hoping for something easier because there are 20+ tables all of different height but common width.

    yes I’m lazy

    bill

  5. 0

    Barry

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi bill,

    Try this:

    Add the new table.

    Drag it to a location just below the table that should precede it.

    Scroll to the last table.

    Drag it down to open enough space for the new table.

    With the bottom table selected, press command-A to select all (tables).

    Make two trips to the Arrange menu:

    Arrange > Align > Left

    Arrange > Distribute > Vertically

    Can be a bit fiddly.

    Regards,

    Barry

  6. 0

    SGIII

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    There is probably a way to script the arrangement of the tables.

    But if you're keeping like data in all the tables, why not just combine them into one table> That way your data will be easy to sort alphabetically. And whenever you want to see a particular stock just apply a filter. Or use Categories (Organize menu) to let Numbers organize them for you.

    SG

  7. 0

    Bill3

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Barry and SG

    Thanks for your help.

    Regards,

    Bill

  8. 0

    SGIII

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    If you haven't tried the one-table approach (which I recommend) here's an AppleScript that will do what you describe with two clicks. It assumes you want to sort by table names (which you've presumably set to stock symbols or company names.)

    1. Copy-paste the script below into Script Editor (in Applications > Utilities)
    2. Make sure Script Editor.app and Numbers.app are listed and checked at System Preferences > Security & Privacy > Privacy > Accessibility.

    Thereafter,

    1. Click somewhere on the sheet where you have the tables.
    2. Click the triangle 'run' button in Script Editor.

    If you do this a lot you can place the script in the Script Menu so it becomes a menu pick.

    SG

    set firstTableXPos to 0 -- 0pt from left -- change as needed
    set firstTableYPos to 30 -- 30pt from top -- change as needed
    set vertSpacing to 55 -- space between tables -- change as needed
    
    tell application "Numbers"
    	tell front document's active sheet
    		set tblNamList to my sortList(tables's name)
    		set yPos to firstTableYPos
    		repeat with n in tblNamList
    			tell table n
    				set tblHeight to its height
    				set tblPos to {firstTableXPos, yPos}
    				set its position to tblPos
    				set yPos to yPos + tblHeight + vertSpacing
    			end tell
    		end repeat
    		
    	end tell
    end tell
    
    to sortList(theList)
    	set theIndexList to {}
    	set theSortedList to {}
    	repeat (length of theList) times
    		set theLowItem to ""
    		repeat with a from 1 to (length of theList)
    			if a is not in theIndexList then
    				set theCurrentItem to item a of theList as text
    				if theLowItem is "" then
    					set theLowItem to theCurrentItem
    					set theLowItemIndex to a
    				else if theCurrentItem comes before theLowItem then
    					set theLowItem to theCurrentItem
    					set theLowItemIndex to a
    				end if
    			end if
    		end repeat
    		set end of theSortedList to theLowItem
    		set end of theIndexList to theLowItemIndex
    	end repeat
    	return theSortedList
    end sortList
    
    

  9. 0

    Bill3

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thanks for your effort. As a long time EXCEL USER, I STARTED MOVING TO NUMBERS BECAUSE OF BETTER stock quote service (oops didn't mean all caps).

    Looking back and getting your opinion I should have used one table for stock purchases since each table is identical. Live and learn.

    Regards,

    Bill

  10. 0

    SGIII

    Imported from the Apple Support Forums via the Wayback Machine 🔗

     I should have used  one table for stock purchases since each table is identical.
    

    Not too late! Add a column to each of the tables, and fill it with the stock symbol. Then copy-paste into one table and add a category to the stock symbol column.

    SG