ObiWanBaloney
New Member
- Joined
- May 10, 2012
- Messages
- 23
Code:
Sub ApplyVlookupFormulatoColumn()
'
' ApplyVlookupFormulatoColumn Macro
'
ActiveCell = _
"=IFERROR(VLOOKUP(E2,'ORDER TEMPLATE'!A:B,2,FALSE),0)"
Dim lastrow As Long
lastrow = Worksheets("ALL ITEMS").Range("A2").End(xlDown).Row
With Worksheets("ALL ITEMS").Range(ActiveCell.Address)
[B] .AutoFill Destination:=Range(ActiveCell.Address & lastrow&)[/B]
End With
End Sub
Bolded part is not working. This is intended to work off whatever cell is selected, hence the activecell.address wherever it appears. Anyone know what to fix in this situation?