• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Matching in macros

Julievdm

New Member
I'm slowly, very slowly learning Macros. What I have slowly learned and have been able to apply has helped me tremendously in my jobs. It has very much sped up my reports. Now I have a new hurdle to cross. I so appreciate all the help I get here.

In my spreadsheet, in column C3:C86, I have a list of names. Then in column F and J, I have information that I need to input into columns Q142:Q225 & R142:R225 based on Matching the names in column C142:225. How do I match the names (the order changes weekly) in C3:C86 to C142:C225. Then take the info in F3:F86 and put it in Q142:Q225. The info from J3:J86 into R142:R225.

Also I need to match the list of names in Column C to the names in column M and take the info from column P and put it in Column H.
Ex C6 has "John Doe" in it. Cell M84 has "John Doe" as well. Cell P84 has a 1/24/2019. I need 1/24/2019 to be entered in cell H6.

My reports are imported into excel so formulas take a long time to set up. It would be so much faster to run a macro. Is this possible to do?
 
Seems it could be easily achieved with Excel Basics via a VLOOKUP formula, whatever manually or by code …​
 
Seems it could be easily achieved with Excel Basics via a VLOOKUP formula, whatever manually or by code …​
Probably but then I have to enter the formulas each time I import the info in excel. I want it to do that for me. Saving a ton of time.
 
perhaps:
Code:
Sub blah()
    RowCount = Range(Range("C143"), Range("C143").End(xlDown)).Rows.Count
    Set myRng = Range("Q143:R143").Resize(RowCount)
    myRng.Columns(1).FormulaR1C1 = "=VLOOKUP(RC[-14],R3C3:R86C4,2,0)"
    myRng.Columns(2).FormulaR1C1 = "=VLOOKUP(RC[-15],R3C13:R104C16,4,0)"
    myRng.Value = myRng.Value
    myRng.NumberFormat = "m/d/yyyy"
End Sub
 
Back
Top