It is literally just a best practice question really.
Is it better practice/more efficient when filling a formula (normally in my case a lookup) down a column in VBA to put any error handing in the formula something like
Dim LastRow As Long
With Sheet1
LastRow = .UsedRange.Rows.Count
.Range(.Cells(2, 16), .Cells(LastRow, 16)).FormulaR1C1 = _
"=if(iserror(vlookup(…)),”not found”,vlookup(…))"
which is what I normally do, or is it better to write any error handling as part of the VBA routine i.e. an "On Error" piece of coding?
Or is it personal preference either way?
Any insight will be gratefully received (and yes in an ideal world I would love all the info at work not to trigger an error in the first place but sometimes it should)
Bookmarks