I have a data table in excel. As data is entered, a VLOOKUP calculates the price of the items sold. What I would like is a way of taking the result of the VLOOKUP in (for example) cell H4 and 'paste special' that figure into cell M4. However, I need it to be dynamic and do this for each row where there is a value in M4. I don't know if this can be automated or if it is simpler to attach a macro to a button that can be clicked at the end of each data entry session.
I have managed to get this far:
but the range is fixed and ideally I need it to work row by row, or maybe relate it to the date of entry (which is entered in another cell in the row) as the LOOKUP reference table will change periodically and I need a fixed figure. Hope this makes sense!
I have managed to get this far:
Code:
Sub Button2_Click()
Sheets("Input").Range("i140:i150").Copy
Sheets("input").Range("k140:k150").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
End Sub
but the range is fixed and ideally I need it to work row by row, or maybe relate it to the date of entry (which is entered in another cell in the row) as the LOOKUP reference table will change periodically and I need a fixed figure. Hope this makes sense!