+ Reply to Thread
Results 1 to 3 of 3

MS Word VBA Randomization of Table

  1. #1
    Forum Contributor
    Join Date
    05-23-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    259

    MS Word VBA Randomization of Table

    Hi Everyone,

    A work colleague asked me to help them simplify a task.

    They have a multi-page list of contractors that gets posted to our website. The contact information for these contractors is in a two column table in word. My colleague would like to randomize the listing every so often (currently around 50 contractors, but will expand a lot in the future). I found a macro that will randomize a single-page table, but the macro fails if the table runs onto a second page (and it won't randomize multiple tables if I split them, only the first table on page one).

    Does anyone think they might be able to modify this code (or replace it) with something that would allow one of the following two possibilities:

    1. A continuous, multi-page two-column table to shuffle its cell text.

    2. Multiple tables (one table per page) where cells from any table can be shuffled to any other.

    If it's relevant, each cell has at least 9 lines of text (meaning 9 times return/enter was pressed)

    Please Login or Register  to view this content.
    Thank you,

    -LM

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: MS Word VBA Randomization of Table

    The following code happily quickly randomises a table spanning multiple pages (tested on a 190-row table spanning 5 pages).
    Please Login or Register  to view this content.
    Note that the code is much simpler than what you started with, yet also assumes the table has a header row (a couple of minor edits would allow it to be used for a table lacking header row).
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Forum Contributor
    Join Date
    05-23-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    259

    Re: MS Word VBA Randomization of Table

    Hi Macropod (awesome name btw),

    After I resolved a few issues with the document I was provided, your code worked like a charm!

    For anyone else who stumbles onto this thread, the header row cannot be a merged cell across both columns. Other than that, works great.

    Cheers!

    -LM

+ 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. Need to randomize and balance the randomization
    By Pat Parker in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-01-2014, 06:16 PM
  2. Macro to do randomization and sorting
    By ajang in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-29-2014, 12:22 AM
  3. Block randomization using formulas
    By abousetta in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-12-2012, 10:46 AM
  4. Need help creating randomization chart
    By amccoart in forum Excel General
    Replies: 2
    Last Post: 05-18-2012, 11:29 AM
  5. Excel Randomization function
    By Push Latency in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-26-2006, 11:43 AM
  6. Data Randomization
    By Hannie1004 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-16-2006, 02:55 PM
  7. [SOLVED] strange randomization
    By William Benson in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-10-2005, 05:05 PM

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