+ Reply to Thread
Results 1 to 4 of 4

macro which takes 100 entries in a column and turns them into a 10x10 matrix

  1. #1
    Forum Contributor
    Join Date
    06-29-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    122

    macro which takes 100 entries in a column and turns them into a 10x10 matrix

    i need to write a macro which takes 100 entries in column in an excel spreadsheet and turns it into a 10x10 matrix on either the same or another sheet.

    in vba code:

    How do i read the first 10 entries in a column then cut and paste them into another column,
    then take the next 10 down of the 90 that are left and put them in the column to the right of
    the first 10 i took away.

    Then what happens when theres 110 in the column and i need to have a 11x10 matrix?

    cheers
    Last edited by intothewild; 09-25-2011 at 06:58 PM. Reason: clarity

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: macro which takes 100 entries in a column and turns them into a 10x10 matrix

    The following code will take any number of cells in column A of the active sheet and use them to make a matrix 10 rows high on the named sheet.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    06-29-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    122

    Re: macro which takes 100 entries in a column and turns them into a 10x10 matrix

    cheers Andrew-R

    Please Login or Register  to view this content.


    ....can you explain a little how the 'With' section works im not so sure i follow it..
    Last edited by intothewild; 09-25-2011 at 06:41 PM.

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: macro which takes 100 entries in a column and turns them into a 10x10 matrix

    It just tells Excel which object you're working with, once you've made a with statement any properties or methods belonging to the object can be referred to by proceeding them with a period.

    So, for example:

    Please Login or Register  to view this content.

    Does the same as:

    Please Login or Register  to view this content.

    As I'm working with the active sheet the with statement probably wasn't needed, it was just force of habit.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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