I am wanting to use VBA to copy cells from one sheet to another sheet in the same workbook based on if the criteria of certain cells match in both sheets.
Example:
If Sheet1!A1 = Sheet2!A1 Then Copy Sheet1!B1 To Sheet2!B2
I could do it via a function: =IF($A1=Sheet1!$A1, VLOOKUP(Sheet1!$A1, Sheet1!$A1:$D1, 2),"")
but am at a loss to make it work in VBA. I thought about an IF|ELSE Statement but couldn't get it to work.
No comments:
Post a Comment