+ Reply to Thread
Results 1 to 8 of 8

copy,paste,format,sort and merge

  1. #1
    Forum Contributor
    Join Date
    01-06-2009
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    415

    copy,paste,format,sort and merge

    hi all
    i have 2 columns in sheet 2 that i transfer column d and g from
    i copy and paste them into columns c and d on sheet 5
    i then highlight column c and remove all duplicates
    i then cut and paste this into column a ( sheet 5 )
    i then do the same with column d
    i have this code so far ( macro recorder )
    what i need is for the macro to put column d into column a (sheet 5 ) but to put it at the next available cell underneath what i had already copy and pasted from column c
    how would i go about this

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Post up your code. (don't forget to put the [code] tags around it)

    The guys here will take a recorded macro and reduce it to a tenth of it's length.

    If you want to try it yourself, the syntax would be:

    Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    01-06-2009
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    415
    this is the code
    the last bit i need to complete is
    cut and paste column c to cell a1
    and then
    cut and paste column d into the next available cell in column a

    Please Login or Register  to view this content.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    I think this does the same thing you want. The only thing I wasn't sure, are you trying to delete NOT import the first cell from source columns? Those are labels? I thought so, so this version copies from cell 2 in those columns.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-06-2009
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    415
    thanks jb
    i am at work now but will have a look when i get home
    thank you

  6. #6
    Forum Contributor
    Join Date
    01-06-2009
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    415
    hi jb
    thanks for your code
    i have adapted it a little to do all that i need it to do which works fine but with one exception
    there is a gap between where the two columns merge and there is no data between rows 790 and 873
    i can see where in the code this affects it but not sure how to put it right

    many thanks in advance
    Please Login or Register  to view this content.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    You'll have to explain more. There's a gap in the raw data? There's a gap in the copied data? A gap caused by the code somehow or a gap the code needs to take into account?

  8. #8
    Forum Contributor
    Join Date
    01-06-2009
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    415
    its leaving a gap between the 2 columns when they merge in sheet players in 1

    for some reason it stops at row 790 and starts again at 873

    i would download it but its over a meg large

+ 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