I have a file that the main purpose is to search a code from the other tab and return it's value in the Search tab.
I tried creating a Match Index and vlookup formulas but it doesn't work.
Please help.
Thanks!
I have a file that the main purpose is to search a code from the other tab and return it's value in the Search tab.
I tried creating a Match Index and vlookup formulas but it doesn't work.
Please help.
Thanks!
I already got the formula and the this VBA code works just fine.
But is there a way to enhance this code to make it faster?
Thanks in advance!Sub RF() Dim lRow As Long Application.Calculation = xlCalculationAutomatic lRow = Range("A:A").Find(what:="*", LookIn:=xlValues, SearchOrder:=xlByRows, _ searchdirection:=xlPrevious).Row Range("B7:AW" & lRow).Formula = "=IFERROR(INDEX(CompiledData!C$2:C$65000,MATCH(1,INDEX(($A7=CompiledData!$A$2:$A$65000)*($A$3=CompiledData!$B$2:$B$65000)*(B$6=CompiledData!C$1),0),0)),0)" Range("B7:AW" & lRow).Copy Range("B7").PasteSpecial Paste:=xlPasteValues Application.CutCopyMode = False Range("L20").Select MsgBox ("DONE") Application.Calculation = xlCalculationAutomatic End Sub
Your code is calculating every cell. Change calculation to manual at the top.
Peace of mind is found in some of the strangest places.
and...
[vba]
with Application
.Calculation = xlCalculationmanual
.screenupdating = false
end with
'Your code
with Application
.Calculation = xlCalculationautomatic
.screenupdating = true
end with
[/vba]
Cheers,
dr
"Questions, help and advice for free, small projects by donation. large projects by quote"
http:\\www.ExcelVBA.joellerabu.com
Thanks!