+ Reply to Thread
Results 1 to 14 of 14

Copy-Paste Special - Transpose values if condition applies

  1. #1
    Registered User
    Join Date
    02-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    21

    Copy-Paste Special - Transpose values if condition applies

    Hi guys and anticipated thanks for the help:

    Let me try describe the data first.
    Worksheet 1:

    C1 C2 C3 .... C8
    M2 M3
    M2 M20
    M2 M31
    M5 M4
    M5 M10
    M5 M13


    To describe it: Column1 contains a value which may repeat...Column 8 has unique values which correspond to the content in Column 1. The "Ms" are random.

    Worksheet 2:

    C1 C2 C3 C4 C5 C....
    M1
    M2
    M3
    M4
    M5
    ...
    M50
    M51
    M52
    ...
    M99
    M100
    ...


    Explain what my macro needs: Has to go through C1 of Worksheet 1and for each M should copy-paste transpose the values from C8 into worksheet 2 C2, C3 (whatever is needed)

    in other words, Worksheet 2 should look like this:

    C1 C2 C3 C4
    M1
    M2 M3 M20 M31
    M3
    M4
    M5 M4 M5 M13
    M6
    M7
    ...


    Many thanks in advance. MUCH MUCH appreciated

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Copy-Paste Special - Transpose values if condition applies

    Please attach a sample workbook, including expected results.

  3. #3
    Registered User
    Join Date
    02-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Copy-Paste Special - Transpose values if condition applies

    Thanks a lot.
    Here is the example data with results expected.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Copy-Paste Special - Transpose values if condition applies

    See if this does what you want:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Copy-Paste Special - Transpose values if condition applies

    This does the trick. Absolutely brilliant! Many many thanks!

  6. #6
    Registered User
    Join Date
    02-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Copy-Paste Special - Transpose values if condition applies

    Hey Stephen.

    I have some problems when trying to actually implement it into my real data.
    Some questions:

    1) Does it still work if cells are actually references rather than actual values (which means that x1Down will go much lower than the last value available
    2) In the real data GIVE CODE and GET CODE (headers) are B3 and I3 respectively (which means that content starts at B4 / I4)
    3) In the actual "Macros Needed" sheet, there is an additional column between A and C.

    I am sorry if this is really easy to adjust and I just don't see it. Could you help me out with this?

    BIG THANKS!

    Florin

  7. #7
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Copy-Paste Special - Transpose values if condition applies

    Florin - easiest if you can attach a small workbook with a representative sample of your actual data.

  8. #8
    Registered User
    Join Date
    02-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Copy-Paste Special - Transpose values if condition applies

    Hi Stephen

    Here is a sample of the Data.
    There's a bunch of vba codes in there which you can disregard.

    Tab "CriticalPath" needs to be populated by the Macro (but starting with column C)

    The data is in INPUT DEPENDENCIES (Column B - starting with B3; and Column I starting with I3)

    Everything else is identical.

    thanks a lot. Totally appreciated.

    Florin
    Last edited by Florinnn; 02-26-2010 at 04:25 PM.

  9. #9
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Copy-Paste Special - Transpose values if condition applies

    OK, having all those blank vlookup formulae is not the most efficient way of doing things. The 'give milestone' values in CriticalPath are taken from the values in column A of the Input Milestones sheet as I understand it. If that's right, would it be an option to copy the latter list to CriticalPath and then run the rest of the macro. If you think that sounds sensible, I can add the copying bit to the beginning of the code.

  10. #10
    Registered User
    Join Date
    02-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Copy-Paste Special - Transpose values if condition applies

    Quote Originally Posted by StephenR View Post
    OK, having all those blank vlookup formulae is not the most efficient way of doing things. The 'give milestone' values in CriticalPath are taken from the values in column A of the Input Milestones sheet as I understand it. If that's right, would it be an option to copy the latter list to CriticalPath and then run the rest of the macro. If you think that sounds sensible, I can add the copying bit to the beginning of the code.
    Yes, that would definitely be an option. As long as the copy-paste is dynamic obviously - the milestone list will grow a lot. Is that possible at all?

    Florin

  11. #11
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Copy-Paste Special - Transpose values if condition applies

    Try this. Every time you run it, it clears the last sheet and copies over the data anew.
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    02-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Copy-Paste Special - Transpose values if condition applies

    Stephen. This seems to do it perfectly. I am amazed. Thanks for being so helpful.
    If I can make up for it, let me know - I see you're from London so I can cover the drinks in a pub

  13. #13
    Registered User
    Join Date
    07-01-2013
    Location
    Surabaya, Indonesia
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Copy-Paste Special - Transpose values if condition applies

    Hi stephen,
    I have a problem in excel 2010, it's about copy-paste transpose.
    May I know your email address?
    I can't attach here.
    thanks

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

    Re: Copy-Paste Special - Transpose values if condition applies

    donnyMV,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.

    Also, its against the forum rules to privately send a file. Create a dummy file which has the same format as your original file and post it here through these steps -

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    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]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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