+ Reply to Thread
Results 1 to 5 of 5

Determining range for dynamic table

  1. #1
    Registered User
    Join Date
    07-18-2011
    Location
    Washington, DC
    MS-Off Ver
    Excel 2007
    Posts
    24

    Determining range for dynamic table

    How do I determine the table range for a table with varying number of columns. I will always have a set number of rows, but the number of columns will vary. The following code creates my columns.

    Please Login or Register  to view this content.
    I will always have 9 rows, but I do not know how many columns. I would like to figure out the range.
    Last edited by kmoore; 07-20-2011 at 03:56 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Determining range for dynamic table

    Why bother? You have Excel 2007 use the Format as Table feature
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    07-18-2011
    Location
    Washington, DC
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Determining range for dynamic table

    I would like it to happen automatically once the user clicks a button. I do not know how to do it if the number of columns can change each time the table is created.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Determining range for dynamic table

    Look in the VBA Help at CurrentRegion

    Returns a Range object that represents the current region. The current region is a range bounded by any combination of blank rows and blank columns.
    Last edited by royUK; 07-20-2011 at 02:39 PM.

  5. #5
    Registered User
    Join Date
    07-18-2011
    Location
    Washington, DC
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Determining range for dynamic table

    Worked perfectly. Thank you!

+ 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