+ Reply to Thread
Results 1 to 4 of 4

Method for selecting a dataset with varying number of rows

  1. #1
    Registered User
    Join Date
    07-14-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    10

    Method for selecting a dataset with varying number of rows

    Hi!

    I have a mostly-completed macro designed to assist in formatting a report that is pulled by a team member every day. The first step in this macro is to convert the data set into a table.

    Effectively, I want to reproduce the native "Ctrl + L" functionality in my macro, so the data range isn't being set to "$A$1:$AH$273", but whatever range that specific data set is contained within.

    I'm very green with VBA, and actually constructed this macro by using the Recorder, and then making changes to turn off refresh, screen scrolling, etc. -- so I'm sure there's a simple fix here I'm overlooking.

    The table conversion portion of this code currently reads as:

    ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$AH$273"), , xlYes).Name = _
    "Table1"

    Any help would be very much appreciated! Thanks!

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Method for selecting a dataset with varying number of rows

    Something like:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    07-14-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    10

    Re: Method for selecting a dataset with varying number of rows

    Quote Originally Posted by xladept View Post
    Something like:

    Please Login or Register  to view this content.
    This worked! Thank you so much!

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Method for selecting a dataset with varying number of rows

    You're welcome and thanks for the rep!

+ 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. Remove rows containing certain phrases & recount number of staff in each dataset
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-28-2015, 10:59 PM
  2. VBA Copy a Varying Number of Whole Rows
    By nosheal in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-22-2014, 12:28 PM
  3. [SOLVED] Standardize number of rows in dataset
    By Test123Test in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-07-2014, 12:59 PM
  4. [SOLVED] How to get a subtotal from a varying number of rows?
    By Mark53 in forum Excel General
    Replies: 4
    Last Post: 08-04-2013, 02:12 PM
  5. Copying a dataset multiple times - and selecting titles for this dataset
    By alocke in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-07-2012, 10:15 PM
  6. Selecting an array with a varying number of sheets
    By cbjorgol in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-13-2008, 09:41 AM
  7. Sum varying number of rows
    By LSkarbek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-12-2006, 11:10 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