I thought I can make a multiplication table and compare the values using Vlookup with Approximate & Exact Match… But I don’t have much time to do that… So anyone I just wanted to share what I arrived so far…
The below will create multiplication table with ratio and sort the data using the values…
Sub CreateMultiplicationTableWithRatio()
Dim i As Long, x As Long, nTemp As Long, vTamp As Variant
Sheets.Add
nTemp = 1
Range("A1:F1").Value = Array("DataToMatch", "Row", "Column", "Table", "Values", "Ratio")
For i = 2 To 100
For x = 2 To 100
nTemp = nTemp + 1: vtemp = 0
If (Int(i / x) - (i / x)) Then vtemp = Int((i / x) * 1000)
Cells(nTemp, "A").Value = (i * x) & "." & vtemp
Cells(nTemp, "B").Value = i
Cells(nTemp, "C").Value = x
Cells(nTemp, "D").Value = i & " x " & x 'Table
Cells(nTemp, "E").Value = i * x
Cells(nTemp, "F").Value = (i / x) 'Ratio
Next x
Next i
Range("A1").CurrentRegion.Sort Key1:=Range("A2"), Order1:=xlAscending, _
Key2:=Range("b2"), Order2:=xlDescending, Key3:=Range("C2"), Order3:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
End Sub
Bookmarks