+ Reply to Thread
Results 1 to 6 of 6

vba code to sort data in two sheets and copy and paste sort data in output sheet

  1. #1
    Registered User
    Join Date
    09-25-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    88

    vba code to sort data in two sheets and copy and paste sort data in output sheet

    Hello everyone!

    Im new to VBA, wondering whether what im trying is possible. Forgive me if this is elsewhere but I've searched for several hours with no luck.
    What I'd like to do is this:I want to sort data in generic and Mandatory & Differentiating sheets and sorting is based on "Y" present in boath sheet and want sort data in output sheet with yellow colour.

    Please find the attached sample file.

    Regards,
    upa
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: vba code to sort data in two sheets and copy and paste sort data in output sheet

    Hi UPA - this would be less fiddly if the two sheets had the same format. Either three sheet all with the same format as "generic" or all three amenity types in the one sheet. Is either viable?
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top right of thread.

  3. #3
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: vba code to sort data in two sheets and copy and paste sort data in output sheet

    Hi UPA - this would be less fiddly if the two sheets had the same format. Either three sheet all with the same format as "generic" or all three amenity types in the one sheet. Is either viable?

    Also - are all the yellow cells to appear at the top of each column as you've shown or alphabetically with the rest? Or do you mean alphabetically within the yellow cells then alphabetically within the non-yellow cells? The example output doesn't seem to match the description ... can you clarify?

  4. #4
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: vba code to sort data in two sheets and copy and paste sort data in output sheet

    Hi UPA. I standardised the data and split the "Mandatory & Differentitating" sheet into two sheets in the same format as the Generic sheet. Code is below and working version in the attached file. Let me know what you think.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-25-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    88

    Re: vba code to sort data in two sheets and copy and paste sort data in output sheet

    Hi MatrixMan, thanks so much for all your hard work and efforts in producing this VBA code - it's amazing and it works very well.

    I have made little change in code
    Call MatchAndSort(ThisWorkbook.Worksheets.Item(2), "Differentiating")
    To
    Call MatchAndSort(ThisWorkbook.Worksheets.Item(3), "Differentiating")

    Now its working fine.

    Regards,
    upa

  6. #6
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: vba code to sort data in two sheets and copy and paste sort data in output sheet

    Ah yes - I neglected to change that when I created the 3rd sheet! Glad it's working for you Don't forget to mark solved & Add Rep if you're happy.

    Cheers, MM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] vba to copy data from rawdata and paste into output sheet depends upon code&child
    By johnmacpro in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2016, 06:52 AM
  2. [SOLVED] VBA Code to copy data from one sheet and paste to multiple other sheets
    By JimmyG. in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-17-2013, 04:25 AM
  3. Code to copy data from multiple sheets into one final output sheet.
    By kenadams378 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-03-2012, 08:51 AM
  4. [SOLVED] Code to copy, sort, paste data from one worksheet to another.
    By wheatgrass in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-03-2012, 11:08 AM
  5. Code to look up, copy, paste, sort data from one worksheet to another
    By wheatgrass in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-14-2012, 11:45 AM
  6. Replies: 0
    Last Post: 06-11-2012, 07:44 PM
  7. Macro to sort data,match,copy paste on to other sheet
    By Benjamin2008 in forum Excel General
    Replies: 1
    Last Post: 12-08-2009, 07:56 AM

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