<COLGROUP><COL style="WIDTH: 475pt; mso-width-source: userset; mso-width-alt: 23149" width=633><TBODY> </TBODY> | ||
Steve
Code:
Code:
|
<TBODY>
</TBODY>
Last edited:
<COLGROUP><COL style="WIDTH: 475pt; mso-width-source: userset; mso-width-alt: 23149" width=633><TBODY> </TBODY> | ||
Steve
Code:
Code:
|
I'm hoping someone can advise why I'm getting such a time difference between two processes doing essentially the same job?
Option Explicit
Sub Macro3()
With Range("AA2:AA" & Cells(Rows.Count, "F").End(xlUp).Row)
.Formula = "=IF(F2="""",-1,VLOOKUP(F2,{""QLD"",-1;""SA"",-1;""ACT"",-2;""NZ"",-2;""WA"",-3;""NT"",-8;""TAS"",-8},2,0))"
'.Value = .Value 'comment out to leave formulae present
End With
End Sub
You only stipulate F2 in the formula, but somehow it still looks at each cell in the range?
The Lookup is wholly contained in the formula, by means of (is it) an array?
Am I able to add states and countries to the array without limit?