0

Hello,

I would like to create a macro. I have two worksheets, both containing an ID. Would like to update the price from the second worksheet corresponding to the ID.

Any ideas? I am quite new to this so a bit of guidance will be appreciated.

2
Contributors
3
Replies
10
Views
3 Years
Discussion Span
Last Post by ddanbe
0

You could startby running the macro recorder and doing the actions you need manually. Look at the macro Excel came up with and generalize the macro to your needs.

0

Okay, I have managed to create the macro

Sub PlaceVLookupTMS()
' place in a standard module
With Sheets("Sheet2")
    .Range("D2:D" & .Range("A" & .Rows.Count).End(xlUp).Row).FormulaR1C1 = _
        "=IFERROR(VLOOKUP(RC[-1],Sheet1!C[-2]:C[1],4,FALSE),"""")"
End With
End Sub

The only problem now is that when there is no match I would like to set the cells to blank. Any ideas?

I have blank cells but they contain the formula: =IFERROR(VLOOKUP(C7,Sheet1!B:E,4,FALSE),"") when I click on them

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.