Sure, there are a few ways to do that. We could convert the UDF into a regular macro and have it read down the column and have it place the answers in the columns as it goes. Or we could convert the UDF into an array formula and use Excel's normal function rules to get the various parts. Since that's quicker, I'll do that, but let me know if you want the other way.
Code:
Public Function GetDiff(ByVal a, ByVal b, ByVal d, ByVal LL, ByVal UL)
Dim i As Long, j As Long
For i = LL To UL
For j = LL To UL
If Round(Abs(i * a - j * b), 10) = d Then
GetDiff = Array(i, j, i * a - j * b)
Exit Function
End If
Next j
Next I
GetDiff = Array("N/A", "N/A", "N/A")
End Function
Install as before, or just change the 2 lines starting with "GetDiff = ".
To use it as an array formula:
Excel 2012
<colgroup><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="bgcolor: #FFFFFF, align: right"]0.74[/TD]
[TD="bgcolor: #FFFFFF, align: right"]1.56[/TD]
[TD="bgcolor: #FFFFFF"]14[/TD]
[TD="bgcolor: #FFFFFF, align: right"]6[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"][/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]1[/TD]
[TD="align: center"]2[/TD]
[TD="bgcolor: #FFFFFF, align: right"]0.47[/TD]
[TD="bgcolor: #FFFFFF, align: right"]1.28[/TD]
[TD="bgcolor: #FFFFFF"]36[/TD]
[TD="bgcolor: #FFFFFF, align: right"]14[/TD]
[TD="align: right"]-1[/TD]
[TD="align: right"][/TD]
[TD="align: right"]36[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]-1[/TD]
[TD="align: center"]3[/TD]
[TD="bgcolor: #FFFFFF, align: right"]74[/TD]
[TD="bgcolor: #FFFFFF, align: right"]156[/TD]
[TD="bgcolor: #FFFFFF"]N/A[/TD]
[TD="bgcolor: #FFFFFF, align: right"]N/A[/TD]
[TD="align: right"][/TD]
[TD="align: center"]4[/TD]
[TD="bgcolor: #FFFFFF, align: right"]47[/TD]
[TD="bgcolor: #FFFFFF, align: right"]128[/TD]
[TD="bgcolor: #FFFFFF"]49[/TD]
[TD="bgcolor: #FFFFFF, align: right"]18[/TD]
[TD="align: right"]-1[/TD]
[TD="align: right"][/TD]
[TD="align: right"]49[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]-1[/TD]
[TD="align: center"]5[/TD]
[TD="bgcolor: #FFFFFF, align: right"]0.235[/TD]
[TD="bgcolor: #FFFFFF, align: right"]1.28[/TD]
[TD="bgcolor: #FFFFFF"]72[/TD]
[TD="bgcolor: #FFFFFF, align: right"]14[/TD]
[TD="align: right"]-1[/TD]
[TD="align: right"][/TD]
[TD="align: right"]72[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]-1[/TD]
</tbody>
Sheet1
[TABLE="width: 85%"]
<tbody>[TR]
[TD]
Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: #DAE7F5"]G1[/TH]
[TD="align: left"]=INDEX(
getdiff(A1,B1,1,1,100),1)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: #DAE7F5"]H1[/TH]
[TD="align: left"]=INDEX(
getdiff(A1,B1,1,1,100),2)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: #DAE7F5"]I1[/TH]
[TD="align: left"]=INDEX(
getdiff(A1,B1,1,1,100),3)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 85%"]
<tbody>[TR]
[TD]
Array Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: #DAE7F5"]C1:E1[/TH]
[TD="align: left"]{=getdiff(
A1,B1,1,1,100)}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
There are 2 ways to do it. The first way is to select 3 cells, C1:E1, all at once, enter the formula, and confirm using Control+Shift+Enter. You can then copy and paste the 3 cells down the column.
The second way is to use INDEX to pull out the element from the array you want. The G1:I1 formulas are entered individually in their cells.
The first way is more efficient since it only makes the calculation once, whereas the second way does it 3 times.
Good luck!