+ Reply to Thread
Results 1 to 21 of 21

VBA to copy and paste

  1. #1
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    VBA to copy and paste

    Hey all, let me say thanks in advance.

    So, Col A B and C will be pasted in from another report. What I would like to happen is the code would look at Col C and if that value is found in Col I which will include every location at the facility, then Col A & B would be copied and pasted into the appropriate location. The appropriate location is of course the matching text value.

    Problem #1 is that sometimes there will be 2 or more trailers in one location systemically. Problem #2 is that some locations have multiple slots available. For example, the locations UL10 through UL50 are more sections than they are locations because the have multiple locations available within them. So for those entries in Col C that have the UL prefix, they would just need to paste as the code encounters them.

    Make sense....? I hope so. Let me know if something more is needed. Thanks.

    The attachment has failed attempts to acheive the desired results using Vlookup, Match & pivot table....
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to copy and paste

    If there needs to be more information, then please let me know.

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

    Re: VBA to copy and paste

    It will be good if you explain your question with the help of your attachment. There are 2 sheets in your file. Which file are you referring to and which columns should be checked?
    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]

  4. #4
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to copy and paste

    Sorry. I'll try to better explain. See the new attachment and look at sheet3. I've included the desired results and more detailed notes. Please let me know if more is needed.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to copy and paste

    Zero views... You folks usually kick butt. Please let me know if I need to be more specific or define something better or anything. Let me help you, help me.

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

    Re: VBA to copy and paste

    Am not able to understand your explanation.

  7. #7
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to copy and paste

    Which aspect of my explanation is causing confusion? The pasted report goes into Col A B & C. From there I need it to "filter" over to the "desired results" section (Col E throu H) based on matching locations. Col I hosts a master list of locations. The areas that are causing me the issues are this; #1 multiple trailers can be assigned to any one location, so I need to accomodate these instances. #2 The locations with the UL prefix are sections that house multiple locations with these sections. So with the other locations without the UL prefix, I would need the SCAC and Trailer# to "filter" into the row, whereas with the UL locations, the preferred result would be to have the SCAC and trailer# simply work its way down the Columns. Did that help?

  8. #8
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to copy and paste

    Any takers? Please help. You guru's have helped me so many times. I have faith.

  9. #9
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to copy and paste

    arlu1201, can you offer anything else?

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

    Re: VBA to copy and paste

    Let me look into this today.

  11. #11
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to copy and paste

    thank you!

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

    Re: VBA to copy and paste

    I was trying to understand your explanation in post 7 but i guess it will be easier if you explain how you get the values in column G & H. I am not able to understand how you get those and what role column I plays in the logic.

  13. #13
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to copy and paste

    Col I contains all physical locations we have at the facility. The info in Col A, B & C are pasted in from another report. Col C contains the location of the trailer systemically. If Col C says that there is a trailer in location 602, then I'd like that scac and trailer number to appear next to Col I's 602.

    Does that help you?

  14. #14
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to copy and paste

    arlu1201, did you give up on me? Could you ask another experience forum member to take a look, please?

  15. #15
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to copy and paste

    Any takers out there?

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

    Re: VBA to copy and paste

    I have passed on your question to a few experts. They should reply to you soon.

  17. #17
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to copy and paste

    Thank you!

  18. #18
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to copy and paste

    If the UL locations are too much of a hassle, then remove them from the master list. I can find a work around for those areas if needed.

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

    Re: VBA to copy and paste

    I've reduced the wb to two sheets. The Master sheet has been corrected so the column A master list of "locations" are all text strings, even the numeric ones. This allows the data dropped into the ReportData sheet to match correctly as it all appears to be text.

    The macro inserts new UL rows if you ever run out while running down the Master list.

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

  20. #20
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to copy and paste

    I'm going to give it a try and I'll will let you know. Not that I doubt you, of course, but I'd like to be sure. Looking at what you posted, I am impressed. Thank you.

  21. #21
    Registered User
    Join Date
    06-10-2010
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to copy and paste

    Worked like a dream. Thank you for saving the day.

+ 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