+ Reply to Thread
Results 1 to 1 of 1

help getting started on nested loop to create a grid of data

  1. #1
    Registered User
    Join Date
    08-26-2010
    Location
    Richmond Hill, Canada
    MS-Off Ver
    Excel 2003
    Posts
    5

    Question help getting started on nested loop to create a grid of data

    Hi,

    I would like to create a table in excel that contains data that would represent a grid of boxes.

    The table below represents the first 4 boxes in a 10 by 10 grid.

    I would like to use a nested do loops to create this 10 by 10 grid.

    The final cell would have a reference point of J10

    If I say that each square has length and width of 100 I believe I can created a nested
    do loop and starting at x=0, y=0 create a table that would present 100 squares each with 4 X,Y coordinates
    for a total of 100 rows and 400 total X,Y points.

    using counters and running total I should be able to build this table in a worksheet incrementally.
    This is only a basic structure I am looking for, my final code would have a starting point that could be 5,4 (x,y) as initial point for example
    Also depending on a variable the y value may dynamically change

    That detail is not necessary for this exericse, however I believe it is important to capture the last known value for x, y to create the next row instead of just multiplying by progressively larger counters
    as my final code will be dependent on changing y values.

    a simple generic strategy or working code would be greatly appreciated.

    Please see the graphic below and the table of data to generate below.

    coordinate_grid1.GIF

    thank you

    Chris

    top left X top left Y top right X top right Y bottom left X bottom left Y bottom right X bottom right Y cell name
    0 0 100 0 0 100 100 100 A1
    101 0 200 0 101 100 200 100 B1
    0 101 100 101 0 200 100 200 A2
    101 101 200 101 101 200 200 200 B2
    Last edited by haggisns; 10-28-2013 at 01:17 PM.

+ 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. Trying to create an output grid/matrix with custom data.
    By JoeTheBro in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-28-2013, 10:47 AM
  2. Need to create a grid from a data set
    By keister21780 in forum Excel General
    Replies: 2
    Last Post: 05-03-2012, 08:23 AM
  3. Next without For error in nested loop - Escaping a Nested Loop?
    By BeneRich in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2012, 06:38 PM
  4. For each loop nested; getting stuck on one cell in first iteration of nested loop
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-22-2009, 11:54 AM
  5. Trying to get a loop started
    By abertrand in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2008, 02:54 PM

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