+ Reply to Thread
Results 1 to 3 of 3

Copying and pasting data tables with changing row counts

  1. #1
    Registered User
    Join Date
    02-12-2013
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    58

    Copying and pasting data tables with changing row counts

    tables.xls

    Hey Excel masterminds,

    I need your help, I have attached a sheet as an example of what I am trying to do in mine. I want to copy table 4 from "Sheet2" and paste it in place of table 2 on "Sheet1". What I am running into is that the data in table 4 is always changing number of rows and when I paste it over into table 2 it doesnt add rows to table 2 to make it the correct size of the data. Any help would be great

    Thanks,
    Alex

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copying and pasting data tables with changing row counts

    For our understanding, you have shown us which is Table2. But how will the macro identify which of these tables is table2? Is there some text which will help us find it and then proceed?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Copying and pasting data tables with changing row counts

    If you go to "Insert" -> "Name" -> "Define" and define the names as "table2" and "table4" for the appropriate ranges you would avoid the problem arlu refer to. You could also have a macro like this to check size of "table2" and adjust it so it fits range of "table4".

    Please Login or Register  to view this content.
    Alf

+ 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