+ Reply to Thread
Results 1 to 2 of 2

selecting a table with variable rows and columns

  1. #1
    Registered User
    Join Date
    07-10-2013
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2010
    Posts
    15

    selecting a table with variable rows and columns

    I’m trying to select all data in a table to move to another sheet, but the table will change every day so I need the selection to change with the table. I’ve used end(xlUp) often to find the bottom row, but I’m not sure how to combine that with a variable column number.

    I keep getting an “Object required” error message.

    Please Login or Register  to view this content.
    Thanks for any help.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: selecting a table with variable rows and columns

    ActiveWorksheet is not a VBA key word. Use ActiveSheet or nothing

    ActiveSheet.Range(Cells(9, 1), Cells(lastrow_source, lastColumn)).Select

    Or

    Range(Cells(9, 1), Cells(lastrow_source, lastColumn)).Select
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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. Selecting Columns and rows via variable input
    By AlistairB in forum Excel General
    Replies: 3
    Last Post: 12-02-2012, 07:20 PM
  2. Selecting a variable number of columns
    By Albathien in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2012, 11:05 AM
  3. Selecting Range with Variable Number of Columns
    By tallandpoofy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-13-2012, 12:53 PM
  4. selecting rows using a variable.
    By cherrynich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-02-2006, 03:30 PM
  5. selecting variable rows in a macro that creates a pivot table
    By amarch00 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2005, 11:06 AM

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