+ Reply to Thread
Results 1 to 2 of 2

Optimising layout of items in a grid

  1. #1
    Registered User
    Join Date
    07-26-2015
    Location
    Cleveland
    MS-Off Ver
    2003,2007,2010,2013
    Posts
    1

    Optimising layout of items in a grid

    Hi, all,

    I figure this should probably be done in VBA, though I could be wrong.

    I've got a grid of variable size - let's say 9*9 for argument's sake. In this grid, I want to lay out two values - let's say A and B - with the constraint that every A must be horizontally or vertically adjacent to a B. Diagonal matches don't count.

    How can I maximise the number of A's in the grid?

  2. #2
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Optimising layout of items in a grid

    This is a heuristic/brute force-type approach:

    checks.xlsm

    DoEvents is in in case you need to Ctrl-C out of an endless loop (but won't happen for the 4x4 grid)

    I'm not sure it's a viable solution for a 9 x 9 grid though, I haven't tried.

    If you need maximum crunching ability, you could implement this as pure-vba quite easily.

+ 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. Replies: 1
    Last Post: 10-29-2013, 02:11 AM
  2. Take Sheet1 layout and Create Sheet2 layout with Macro
    By theglitch in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-18-2013, 03:50 PM
  3. Replies: 2
    Last Post: 12-15-2011, 04:14 AM
  4. Convert data from column layout to row layout
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2010, 03:28 PM
  5. Optimising with Formula
    By andrewc in forum Excel General
    Replies: 0
    Last Post: 06-17-2010, 07:46 AM
  6. Optimising row selection
    By dems in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2010, 03:50 AM
  7. optimising this VBA
    By brave.inf in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2009, 09:44 AM
  8. [SOLVED] Help with optimising code
    By FrigidDigit in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-20-2005, 11:05 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