+ Reply to Thread
Results 1 to 3 of 3

Resize range (table) in VBA based on last row value in another worksheet

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    1

    Question Resize range (table) in VBA based on last row value in another worksheet

    Hi
    I have a worksheet where data is pasted from an external source.
    I then have a second worksheet which is a formatted table with various formulas in each cell that converts the data from the worksheet where the data is pasted.

    I want to create a macro that resizes the table/range in worksheet 2 to the same number of rows in the first worksheet. The purpose here is to extend the formulas up or down in the formula table depending on the row count of the first worksheet.

    I'm open to suggestions here, but what I've tried so far is putting the

    My first macro finds the last row in the worksheet and pastes it in a field.

    Please Login or Register  to view this content.
    I was hoping to then use this cell to reference the row count in my resize table macro. i.e instead of the range reference (Range("$A$1:$X$2985")).

    Please Login or Register  to view this content.
    Any thoughts?

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Resize range (table) in VBA based on last row value in another worksheet

    your goal is not very clear for me, but try this
    Please Login or Register  to view this content.
    have a look on http://msdn.microsoft.com/en-us/libr...ice.10%29.aspx
    If solved remember to mark Thread as solved

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

    Re: Resize range (table) in VBA based on last row value in another worksheet

    Try something like this...

    Please Login or Register  to view this content.
    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. Add row to end of table and resize table automatically
    By cdthimann in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2013, 03:30 AM
  2. Replies: 5
    Last Post: 01-26-2013, 01:55 PM
  3. changing range selection for pivot table based on worksheet
    By twhitezell in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-07-2010, 11:49 AM
  4. [SOLVED] Mapping one table based on another table range
    By waynehamilton in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-12-2005, 12:07 AM
  5. [SOLVED] Range.Delete and Range.Resize.Name performance issues
    By Test.File in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2005, 12:54 PM

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