Closed Thread
Results 1 to 22 of 22

match up formula

Hybrid View

  1. #1
    Registered User
    Join Date
    03-28-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    28

    match up formula

    hi, this is my first topic and im not very clued up on forums, just though it would be a good place for some urgent help, ok, this is my question, as per my file i want to match up data from column D with data from column B and if found match, copy it to column C to the same raw as the match found, i hope someone out there can give me some help its very much appreciated.

    thanks in advance

    jorge
    Attached Files Attached Files

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: match up formula

    Maybe this in C2 copied down: =INDEX($A$2:$A$308,MATCH(D2,$B$2:$B$308,0))

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    03-28-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: match up formula

    hi, many thanks, that wasn't exactly what i wanted but i think it actually worked a lot better because the idea was exactly that to match the sku, so many thanks, how amazing is this 2 minutes waiting and got a reply and solutions, wow.

    regards


    Jorge

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: match up formula

    It must be psychic Monday

    Dom

  5. #5
    Registered User
    Join Date
    03-28-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: match up formula

    lol, maybe you can also tell me if instead of matching and coping the column A into column C, i would do the same but match the column D with column A and copy into column C (same raw as match) the ones that match, do i make sense ??

    regards

    Jorge

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: match up formula

    Can you post an example of what you want this to finish up looking like, not sure I follow.

    Dom

  7. #7
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: match up formula

    How about this?

    It loops through the entries in column D and where a match is found in column B puts the value in column C and deletes the entry from D. You would therefore only be left in D with items that could not be found.

    Sub test()
    
    Dim rngSearchRange As Range
    Dim rngFindRange As Range
    Dim lngLoopRow As Long
    
    Set rngSearchRange = Range("B2:B" & Cells(Rows.Count, 2).End(xlUp).Row)
    
    For lngLoopRow = Cells(Rows.Count, 4).End(xlUp).Row To 2 Step -1
    
        With Range("D" & lngLoopRow)
    
            Set rngFindRange = rngSearchRange.Find(.Value, LookIn:=xlValues, lookat:=xlWhole)
            
            If Not rngFindRange Is Nothing Then
            
                rngFindRange.Offset(0, 1) = .Value
                .Delete xlShiftUp
                
            End If
    
        End With
        
    Next lngLoopRow
    
    End Sub

    The code needs to be placed in a regular code module and will work on the active worksheet.

    Dom

  8. #8
    Registered User
    Join Date
    03-28-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: match up formula

    Hi Dom, it works fine however it doesn't copy the matched cells over to the column C but it does indeed remove the matched cells from column D but i need both columns, column C with the matched results ( in the same raw as the match) and column D with all the cells that don't match. thanks again, you have been great.

    jorge

  9. #9
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: match up formula

    Seems to work for me if I've understood you. See attached example.

    Dom
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    03-28-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: match up formula

    Hi Dom,

    yes it does indeed many thanks once again, you have been amazing and very patient, any advise where i could have a crush course on excel? is lynda.com a good start?

    jorge

  11. #11
    Registered User
    Join Date
    03-28-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: match up formula

    Hi Dom,

    how do you create that macro button? its very cool and convenient.

    jorge

  12. #12
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: match up formula

    Never heard of Lynda.com until you mentioned it. The problem with most courses I've come across is that they tend to focus on using Excel functions without really explaining how the application itself really works. I guess they are okay but you'd do far worse than getting a decent Excel book and asking questions on places like this. You'll learn far more than a general course will give you if you're prepared to put in some work yourself.

    For the macro button you just draw it off the Forms toolbar and Excel will ask you if you want to attach a macro to it.

    Dom

  13. #13
    Registered User
    Join Date
    03-28-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: match up formula

    hi Dom,

    many thanks once again for your great help.

    jorge

  14. #14
    Registered User
    Join Date
    03-28-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: match up formula

    Hi Dom,

    Over a year ago you were a great help and made up a formula to me that has been a fantastic help for me and my work (here is the tread for that http://www.excelforum.com/excel-gene...-new-post.html ) however i have now come to a situation where i need to extend that formula further, where before i needed to match up the data from one column with another i now need the same formula but i also need the 3 following columns to follow as well, im enclosing a sheet with the initial formula you done for me and what else i would like, i hope im not being chicky and asking for help again and i really hope you can help me again.

    The idea is to match column D with the data from column B and move matching results to column C however this updated formula needs also to move all the data from column E F G H I J along with column D but its the D data that needs to match the data from column B, columns E F G H I J need to follow the Data from D. i hope you understand what i mean.

    many thanks once again.
    Attached Files Attached Files
    Last edited by monteiro1969; 05-13-2012 at 02:52 PM. Reason: adding file

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

    Re: match up formula

    Monteiro1969,

    Don't post a question in an older thread -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    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]

Closed 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