+ Reply to Thread
Results 1 to 12 of 12

VBA Copying mixed data to specified sheets based on criteria

  1. #1
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    VBA Copying mixed data to specified sheets based on criteria

    Attached file
    Looking for a macro that will sort data on the TripCancelDetailexport.rpt worksheet to the corresponding NVA and TPNO worksheets into the proper region.
    The TPNO and NVA are designated in col X; the region is in col Q
    There are two additional worksheets that are samples of how they should look when done (more data obviously) those pages also have light instructions.

    Thanks again for all you assistance.
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA Copying mixed data to specified sheets based on criteria

    I needed a helper sheet but I dump it at the end of the routine - anyway try:

    Please Login or Register  to view this content.
    Last edited by xladept; 02-19-2016 at 05:50 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: VBA Copying mixed data to specified sheets based on criteria

    Wow - it's starting to take shape
    The macro inserts a couple columns incorrectly.
    On NVA
    should place cancel reason in Column E not F; the Cancel Date goes into Col F not G; and the Facility goes to Col G not H
    On the TPNO
    Should place Cancel reason in Column E not F; The Cancel Date goes into Col F not G - G is missing the Transportation Provider -The Facility is correct in H

    I'm amazed at how you did this and I'm trying to understand your code.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA Copying mixed data to specified sheets based on criteria

    Hi James,

    I already fixed that - I had forgotten to hide W

    I used the autofilter and copy-pasted the visible cells, with a short detour

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA Copying mixed data to specified sheets based on criteria

    I see what happened - The NVA doesn't take from AA but the TPNO does

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: VBA Copying mixed data to specified sheets based on criteria

    The TPNO headers are slightly different than the NVA - Transportation Provider from colAA goes in col G of the TPNO - The NVA worksheet does not get a Transportation Provider column.
    The Facility on the TPNO is one column to the right of where it would be on the NVA worksheet - If it is easier I can swap the headers for Facility and Transportation Provider - then just need Transportation provider to populate
    Which ever is easier.

    Thanks
    Jim

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA Copying mixed data to specified sheets based on criteria

    Try it now

    Please Login or Register  to view this content.
    Last edited by xladept; 02-19-2016 at 06:20 PM.

  8. #8
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: VBA Copying mixed data to specified sheets based on criteria

    Thanks Orrin
    Appreciate it - great use of code and helper sheets.
    Jim

  9. #9
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: VBA Copying mixed data to specified sheets based on criteria

    Thanks Orrin
    Appreciate it - great use of code and helper sheets.
    Jim

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA Copying mixed data to specified sheets based on criteria

    You're welcome and thanks for the rep!

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA Copying mixed data to specified sheets based on criteria

    I got rid of that helper sheet

    Please Login or Register  to view this content.

  12. #12
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA Copying mixed data to specified sheets based on criteria

    I got rid of that helper sheet

    Please Login or Register  to view this content.

+ 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. Replies: 3
    Last Post: 07-18-2015, 02:06 PM
  2. [SOLVED] Pulling Data from two separate sheets based on criteria on both those sheets
    By mlbdc2012 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2015, 03:57 PM
  3. Replies: 8
    Last Post: 07-09-2014, 10:42 PM
  4. [SOLVED] Ignoring Blanks or Criteria in copying data between sheets
    By TexasKersh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2014, 10:00 AM
  5. [SOLVED] Copying data and paste to other sheets with criteria
    By rarementality in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-07-2014, 01:17 AM
  6. Copying data to other sheets by criteria
    By Tuclis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-12-2013, 05:04 PM
  7. Replies: 4
    Last Post: 01-08-2013, 12:37 PM

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