I used the macro recorder to get the initial code and incorporated it into the following:
Code
Dim lastRow As Integer
Dim lastRowInvoice As Integer
lastRow = Worksheets("Sheet1").Range("A1").End(xlDown).Row
lastRowInvoice = Worksheets("Invoice").Range("A1").End(xlDown).Row
Columns("A:A").Select
Selection.Copy
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Range("E1").Select
ActiveCell.FormulaR1C1 = _
"=CONCATENATE(VLOOKUP(RC[-4],Sheet1!R1C1:R" & lastRow & "C3,2,FALSE) & "" / "" & VLOOKUP(RC[-4],Sheet1!R1C1:R" & lastRow & "C3,3,FALSE))"
Range("E1").Select
Selection.AutoFill Destination:=Range("E1:E" & lastRowInvoice)
Range("E1:E" & lastRowInvoice).Select
Calculate
Columns("E:E").EntireColumn.AutoFit
Display More
I'm thinking the line beginning "ActiveCell.FormulaR1C1" is not the best way to do this?
I'm trying to tidy up the code as best I can
Also posted here: