+ Reply to Thread
Results 1 to 6 of 6

Copy varying amounts of data between sheets

Hybrid View

  1. #1
    Registered User
    Join Date
    07-06-2008
    Location
    Indiana
    Posts
    3

    Copy varying amounts of data between sheets

    What I'm trying to do is be able to copy data which is inserted on a sheet onto another sheet. The problem I'm having is that the data being inserted is not always going to be the same amount. For example, a set of data could be entered which only consists of 100 points but I also want all the data to be copied if 1000 data points are inserted. Any pointers or tips will be much appreciated.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    1) how many columns of data are being transferred - or is this variable as well as the number of rows.

    2) Is there always a column which will always have data and can be used to find the last row. Same sort of thing for the columns if it is variable.

    rylo

  3. #3
    Registered User
    Join Date
    07-06-2008
    Location
    Indiana
    Posts
    3
    There will always just be two columns. Only the number of rows varies. There is also going to be data inputted starting with the same cell to allow for the search for the last row.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Something like

    range("A1:B" & cells(rows.count,1).end(xlup).row).copy
    will select a range starting in A1, 2 columns wide, and with a variable number of rows based on the data in column A.

    HTH

    rylo

  5. #5
    Registered User
    Join Date
    07-06-2008
    Location
    Indiana
    Posts
    3
    This may be very simple, but I'm having some trouble with pasting the copied range onto a different sheet.

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Here goes
    Range("A1:B" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=Sheets("Sheet2").Range("A1")
    Data is on sheet1, and you are currently on that sheet.

    rylo

+ 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