+ Reply to Thread
Results 1 to 6 of 6

Adjust selected range

  1. #1
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Adjust selected range

    I am selecting a range of cell into which I paste data. I want to paste the data from the top cells selected, down to the last empty cell in the column. The code I am using looks like this, but this paste the data from the selection down into the first cell containing data, overwriting my first row of existing data.

    Please Login or Register  to view this content.
    I tried to offset the range using the code below, but it offsets the TOP of the range, rather than the bottom, so the paste overwrites my column headings.

    Please Login or Register  to view this content.
    I'm sure this is an easy one for you guys. Please help.

    Thanks in advance.

    Jerry

  2. #2
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717
    Hi,

    I think what you want to achieve can be achieved by the below code.


    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Didn't work...

    Thanks, Kumar, but the code didn't work as you had it. I changed a couple of things to remove the errors, but I'm getting the same results as earlier, filldown and paste down both copy the new data over the first row of existing data.

    Here is the code after my revisions:
    Please Login or Register  to view this content.
    Thanks for trying.

  4. #4
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717
    can you upload a sample sheet with data and intended result so that i can write the macros and match the result and upload it back

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419
    Try this offset syntax.
    From current row down to end row-1

    Please Login or Register  to view this content.
    If not can you post example workbook with dummy data in the correct layout.
    Cheers
    Andy
    www.andypope.info

  6. #6
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    That's it...

    That's it, Andy.

    I just had the offset in the wrong place.

    Thanks.

+ 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