Hi can anyone help with the following code?
On Sheet2 I have the following
MyLetters in "E4:K4"
MyNumbers in "D5:D30"<strike></strike>
MyData in "E5:K30"
MyResults in "AN20:AT26"<strike></strike>
The code works fine but I want to change the results so that instead of Indexing every row with (MyLetters) within (MyData) into the Results, I want to index the Rows that only have 2 or more of (MyLetters) into the Results. In the example below (ResultsA) shows the results using every Row and (MyLetters) and ResultsB shows what the results would be if only indexing Rows with 2 or more MyLetters.(To get ResultsB I cleared all the Letters on rows(5,8,11,13,14,16,22,24,25,28 and ran the code again)
Could I add something like 'COUNTIF(Row, MyData) >= 2' to the code somewhere to achieve this?
[TABLE="width: 730"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]I[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]MyLtrs[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Results A[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]40[/TD]
[TD="align: center"]43[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]AN[/TD]
[TD="align: center"]AO[/TD]
[TD="align: center"]AP[/TD]
[TD="align: center"]AQ[/TD]
[TD="align: center"]AR[/TD]
[TD="align: center"]AS[/TD]
[TD="align: center"]AT[/TD]
[TD="align: center"]AU[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]38[/TD]
[TD="align: center"]41[/TD]
[TD="align: center"][/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]30[/TD]
[TD="align: center"]41[/TD]
[TD="align: center"]44[/TD]
[TD="align: center"][/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]37[/TD]
[TD="align: center"]40[/TD]
[TD="align: center"][/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]31[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]45[/TD]
[TD="align: center"][/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]26[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"]36[/TD]
[TD="align: center"]39[/TD]
[TD="align: center"][/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]26[/TD]
[TD="align: center"]26[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]11[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]32[/TD]
[TD="align: center"]43[/TD]
[TD="align: center"]46[/TD]
[TD="align: center"][/TD]
[TD="align: center"]25[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]12[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]16[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]35[/TD]
[TD="align: center"]38[/TD]
[TD="align: center"][/TD]
[TD="align: center"]26[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]13[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]16[/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]44[/TD]
[TD="align: center"]47[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]14[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]34[/TD]
[TD="align: center"]37[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Results B[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]15[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]34[/TD]
[TD="align: center"]45[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]AN[/TD]
[TD="align: center"]AO[/TD]
[TD="align: center"]AP[/TD]
[TD="align: center"]AQ[/TD]
[TD="align: center"]AR[/TD]
[TD="align: center"]AS[/TD]
[TD="align: center"]AT[/TD]
[TD="align: center"]AU[/TD]
[/TR]
[TR]
[TD="align: center"]16[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]36[/TD]
[TD="align: center"][/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]17[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]35[/TD]
[TD="align: center"]46[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"][/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]18[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]-1[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]32[/TD]
[TD="align: center"]35[/TD]
[TD="align: center"][/TD]
[TD="align: center"]22[/TD]
[TD="align: center"][/TD]
[TD="align: center"]26[/TD]
[TD="align: center"][/TD]
[TD="align: center"]26[/TD]
[TD="align: center"][/TD]
[TD="align: center"]26[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]19[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]28[/TD]
[TD="align: center"]36[/TD]
[TD="align: center"]47[/TD]
[TD="align: center"]50[/TD]
[TD="align: center"][/TD]
[TD="align: center"]23[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]20[/TD]
[TD="align: center"]16[/TD]
[TD="align: center"]-2[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]31[/TD]
[TD="align: center"]34[/TD]
[TD="align: center"][/TD]
[TD="align: center"]24[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]21[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]37[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]51[/TD]
[TD="align: center"][/TD]
[TD="align: center"]25[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]22[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]-3[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]30[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"][/TD]
[TD="align: center"]26[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]23[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]16[/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]30[/TD]
[TD="align: center"]38[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]52[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]24[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]-4[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]32[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]25[/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]31[/TD]
[TD="align: center"]39[/TD]
[TD="align: center"]50[/TD]
[TD="align: center"]53[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]26[/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]-5[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]28[/TD]
[TD="align: center"]31[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]27[/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]28[/TD]
[TD="align: center"]32[/TD]
[TD="align: center"]40[/TD]
[TD="align: center"]51[/TD]
[TD="align: center"]54[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]28[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]-6[/TD]
[TD="align: center"]-1[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]16[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]30[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]29[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]41[/TD]
[TD="align: center"]52[/TD]
[TD="align: center"]55[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]30[/TD]
[TD="align: center"]26[/TD]
[TD="align: center"]-7[/TD]
[TD="align: center"]-2[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]D[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
<strike>
</strike>
Any help would be appreciated
Regards
pwill
On Sheet2 I have the following
MyLetters in "E4:K4"
MyNumbers in "D5:D30"<strike></strike>
MyData in "E5:K30"
MyResults in "AN20:AT26"<strike></strike>
The code works fine but I want to change the results so that instead of Indexing every row with (MyLetters) within (MyData) into the Results, I want to index the Rows that only have 2 or more of (MyLetters) into the Results. In the example below (ResultsA) shows the results using every Row and (MyLetters) and ResultsB shows what the results would be if only indexing Rows with 2 or more MyLetters.(To get ResultsB I cleared all the Letters on rows(5,8,11,13,14,16,22,24,25,28 and ran the code again)
Could I add something like 'COUNTIF(Row, MyData) >= 2' to the code somewhere to achieve this?
Code:
[FONT=Verdana]
Sub IndexMyData()
[/FONT]
[FONT=Verdana] Dim MyRow(26), InSht As Worksheet, OutSht As Worksheet
Dim c As Integer
Dim i As Long
Dim j As Long
Dim r As Long
Dim MyResults
Dim CustOrd
Dim MyData
Dim MyNums
Dim MyLtrs
Application.EnableEvents = False
Set InSht = Sheet2
Set OutSht = Sheet2
Set MyResults = OutSht.Range("AN20:AT26")
MyData = InSht.Range("E5:K30")
MyNums = InSht.Range("D5:D30")
MyLtrs = InSht.Range("E4:K4")
For i = 1 To 26
MyRow(i) = " " & Join(WorksheetFunction.Index(MyData, i, 0)) & " "
CustOrd = CustOrd & MyNums(i, 1) & ","
Next i
MyResults.ClearContents
For i = 1 To 7
c = 0
For j = 1 To 26
If InStr(MyRow(j), " " & MyLtrs(1, i) & " ") > 0 Then
c = c + 1
MyResults.Cells(c, i) = MyNums(j, 1)
If c = 7 Then Exit For
End If
Next j
Next i
With OutSht.Sort
.SortFields.Clear
For i = 1 To 7
.SortFields.Add Key:=MyResults.Cells(i, 1), CustomOrder:=CVar(CustOrd)
Next i
.SetRange MyResults
.Orientation = xlLeftToRight
.Apply
End With
Application.EnableEvents = True
End Sub[/FONT]
[TABLE="width: 730"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]I[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]MyLtrs[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Results A[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]40[/TD]
[TD="align: center"]43[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]AN[/TD]
[TD="align: center"]AO[/TD]
[TD="align: center"]AP[/TD]
[TD="align: center"]AQ[/TD]
[TD="align: center"]AR[/TD]
[TD="align: center"]AS[/TD]
[TD="align: center"]AT[/TD]
[TD="align: center"]AU[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]38[/TD]
[TD="align: center"]41[/TD]
[TD="align: center"][/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]30[/TD]
[TD="align: center"]41[/TD]
[TD="align: center"]44[/TD]
[TD="align: center"][/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]37[/TD]
[TD="align: center"]40[/TD]
[TD="align: center"][/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]31[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]45[/TD]
[TD="align: center"][/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]26[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"]36[/TD]
[TD="align: center"]39[/TD]
[TD="align: center"][/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]26[/TD]
[TD="align: center"]26[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]11[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]32[/TD]
[TD="align: center"]43[/TD]
[TD="align: center"]46[/TD]
[TD="align: center"][/TD]
[TD="align: center"]25[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]12[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]16[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]35[/TD]
[TD="align: center"]38[/TD]
[TD="align: center"][/TD]
[TD="align: center"]26[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]13[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]16[/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]44[/TD]
[TD="align: center"]47[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]14[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]34[/TD]
[TD="align: center"]37[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Results B[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]15[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]34[/TD]
[TD="align: center"]45[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]AN[/TD]
[TD="align: center"]AO[/TD]
[TD="align: center"]AP[/TD]
[TD="align: center"]AQ[/TD]
[TD="align: center"]AR[/TD]
[TD="align: center"]AS[/TD]
[TD="align: center"]AT[/TD]
[TD="align: center"]AU[/TD]
[/TR]
[TR]
[TD="align: center"]16[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]36[/TD]
[TD="align: center"][/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]17[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]35[/TD]
[TD="align: center"]46[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"][/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]18[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]-1[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]32[/TD]
[TD="align: center"]35[/TD]
[TD="align: center"][/TD]
[TD="align: center"]22[/TD]
[TD="align: center"][/TD]
[TD="align: center"]26[/TD]
[TD="align: center"][/TD]
[TD="align: center"]26[/TD]
[TD="align: center"][/TD]
[TD="align: center"]26[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]19[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]28[/TD]
[TD="align: center"]36[/TD]
[TD="align: center"]47[/TD]
[TD="align: center"]50[/TD]
[TD="align: center"][/TD]
[TD="align: center"]23[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]20[/TD]
[TD="align: center"]16[/TD]
[TD="align: center"]-2[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]31[/TD]
[TD="align: center"]34[/TD]
[TD="align: center"][/TD]
[TD="align: center"]24[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]21[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]37[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]51[/TD]
[TD="align: center"][/TD]
[TD="align: center"]25[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]22[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]-3[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]30[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"][/TD]
[TD="align: center"]26[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]23[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]16[/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]30[/TD]
[TD="align: center"]38[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]52[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]24[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]-4[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]32[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]25[/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]31[/TD]
[TD="align: center"]39[/TD]
[TD="align: center"]50[/TD]
[TD="align: center"]53[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]26[/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]-5[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]28[/TD]
[TD="align: center"]31[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]27[/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]28[/TD]
[TD="align: center"]32[/TD]
[TD="align: center"]40[/TD]
[TD="align: center"]51[/TD]
[TD="align: center"]54[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]28[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]-6[/TD]
[TD="align: center"]-1[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]16[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]30[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]29[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"]19[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]41[/TD]
[TD="align: center"]52[/TD]
[TD="align: center"]55[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]30[/TD]
[TD="align: center"]26[/TD]
[TD="align: center"]-7[/TD]
[TD="align: center"]-2[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]D[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
<strike>
</strike>
Any help would be appreciated
Regards
pwill
Last edited: