+ Reply to Thread
Results 1 to 2 of 2

Create Table using Variable Column and Rows

  1. #1
    Registered User
    Join Date
    04-03-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Create Table using Variable Column and Rows

    The only code I can find for creating tables is something like this:

    ActiveSheet.ListObjects.Add(xlSrcRange, Range("$B$1:$D$16"), , xlYes).Name = "Table1"

    This converts cells from B1 to D16 into a table.

    Let's say I have different values from different cells: A1=2, A2=3, A3=1, A4=4. There's a command button in the worksheet.

    I click the command button to create a table with the number of columns equal to the added up values of the above cells (Total is 10). How do I do it?

    And let's say I declare a few variables: num1=1, num2=2, num3=3, num4=4. I want to create an equal number of rows or columns in a table to the total value of the variables above (Or individual variable value only such as num1) above. Could it be written?

    In short, can someone give me examples on how to create tables with varying numbers of columns and rows?

  2. #2
    Registered User
    Join Date
    04-03-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Create Table using Variable Column and Rows

    Bump. Need urgent help on this.

+ 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