+ Reply to Thread
Results 1 to 11 of 11

Copy, Paste, Tidy macro help

  1. #1
    Registered User
    Join Date
    01-27-2009
    Location
    NZ
    MS-Off Ver
    Excel 200a
    Posts
    14

    Red face Copy, Paste, Tidy macro help

    G'day.
    A while ago JBeaucaire provided me with code for a macro that copied data from one sheet, pasted it into another sheet, deleted empty and duplicate cells and sorted the results. I tweaked the code to get it to work in my work book and ended up with the following code:
    Please Login or Register  to view this content.
    Can anyone tell me how to make the code paste the first result into cell A2 so I can have a title in cell A1. I'm sure it is very easy, I just don't know how to do it.

    Cheers
    Last edited by falcon5nz; 07-20-2009 at 08:47 AM. Reason: Solved

  2. #2
    Registered User
    Join Date
    01-27-2009
    Location
    NZ
    MS-Off Ver
    Excel 200a
    Posts
    14

    Re: Copy, Paste, Tidy macro help

    Ideas anyone?

  3. #3
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: Copy, Paste, Tidy macro help

    Im not the best with this stuff though it seams that you have a heading of "list" in cell A1

  4. #4
    Registered User
    Join Date
    01-27-2009
    Location
    NZ
    MS-Off Ver
    Excel 200a
    Posts
    14

    Re: Copy, Paste, Tidy macro help

    That gets deleted in the clean up section

  5. #5
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: Copy, Paste, Tidy macro help

    if you take Rows("1:1").Delete out does it leave the heading like you want.

  6. #6
    Registered User
    Join Date
    01-27-2009
    Location
    NZ
    MS-Off Ver
    Excel 200a
    Posts
    14

    Re: Copy, Paste, Tidy macro help

    No. Ideally I want to have the headings:
    Head-stamp in A1
    Manufacturer in B1
    Country of Origin in C1
    With the list of headstamps in Column A etc
    I have attached a quick book with what I have (Sheet:Headstamp Table) and what I need (Headstamp ID)
    Attached Files Attached Files

  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

    Re: Copy, Paste, Tidy macro help

    Try this, it will clear the existing Headstamp ID sheet and reinsert a new, unduplicated, sorted set of values in column A. You'll have to add the column B and C stuff since none of that exists anywhere in the original data.

    Please Login or Register  to view this content.
    _________________
    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!)

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy, Paste, Tidy macro help

    Actually, now that I thought about it, I realized you might want to KEEP the existing Manufacturer and Country entries each time you rerun the sheet to create a new listing of Headstamps. Yes?

    If so, use this version. It will backup the existing Headstamp ID sheet, create a new one with new a new list of IDs and then fit the old B & C values back into the sheet from the backup sheet.

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 07-18-2009 at 12:10 AM.

  9. #9
    Registered User
    Join Date
    01-27-2009
    Location
    NZ
    MS-Off Ver
    Excel 200a
    Posts
    14

    Re: Copy, Paste, Tidy macro help

    Thank you JBeaucaire. That second code is EXACTLY what I want, BUT (theres always a but) it is picking up the info from column A. How do I change it so it only collects the cells from column B across?

    Cheers for all your help guys

    Nick

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy, Paste, Tidy macro help

    This line of code:
    Please Login or Register  to view this content.
    ...means start in column "1" and go to the last column (LC), so just change the 1 to a 2.

  11. #11
    Registered User
    Join Date
    01-27-2009
    Location
    NZ
    MS-Off Ver
    Excel 200a
    Posts
    14

    Re: Copy, Paste, Tidy macro help

    Brilliant. Guys you have no idea how thankful I am.

+ 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