+ Reply to Thread
Results 1 to 4 of 4

M code syntax creating table

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    775

    M code syntax creating table

    Hello all,
    I've been looking at introctions to M and have been trying to create this

    = #table ({"A","B"},({1,2},{3,4}{5,7}))
    Which I think should give me

    A B

    1 2
    3 4
    5 7

    But it don't. What am I doing wrong? I haven't attached anything as but can, I have been able to create blank using

    #table ( {},{}), which I notice only has the opening and closing parenthesis. Any help or pointers to more information gratefully received.

    Richard.
    Last edited by AliGW; 12-22-2021 at 12:39 PM. Reason: Code tags added.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,695

    Re: M code syntax creating table

    You seem to have a comma missing:

    = #table ({"A","B"},({1,2},{3,4},{5,7}))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,985

    Re: M code syntax creating table

    The internal ones should be curly brackets:

    = #table({"A","B"},{{1,2},{3,4},{5,7}})
    Everyone who confuses correlation and causation ends up dead.

  4. #4
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    775

    Re: M code syntax creating table

    Thanks, to both of you. It was the {{ }} I needed and not ({ }) for the rows.

+ 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. VBA Code for Creating Pivot Table
    By aravindkm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2013, 03:30 PM
  2. how to code a macro for creating a table in word and fill the colums with data ?
    By giriprasad in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2012, 11:45 PM
  3. [SOLVED] Syntax for Creating an Integer List
    By publius190 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2012, 10:58 AM
  4. Writing Code for creating pivot table
    By kw42chan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-03-2011, 11:40 AM
  5. Creating New Tab Syntax Error
    By Dragonruler12 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-25-2008, 04:14 PM
  6. [SOLVED] Need help with creating a Range Name syntax
    By Paul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2006, 03:45 PM
  7. [SOLVED] Syntax of VBA Code
    By Ken Hudson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2005, 06:05 PM
  8. Syntax of this code
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2005, 07:06 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