Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok !! With this code working perfect !</p> <p>In 1st sub xromata(colors in Greek) i have some set for deferents worksheets. After this call the sortarisma with reference the first column the different to the second column and the number of rows !!</p> <pre><code>Sub Xromata(a As Integer) If a = 1 Then Call Sortarisma(11, 3, 103) ElseIf a = 2 Then Call Sortarisma(12, 3, 111) ElseIf a = 3 Then Call Sortarisma(9, 2, 103) ElseIf a = 4 Then Call Sortarisma(10, 2, 111) ElseIf a = 5 Then Call Sortarisma(11, 4, 103) Call Sortarisma(12, 4, 103) ElseIf a = 6 Then Call Sortarisma(12, 4, 111) Call Sortarisma(13, 4, 111) Else End If End Sub Sub Sortarisma(arxi As Integer, per As Integer, numofrows As Integer) Dim Arr(1 To 6) As Single Dim i As Integer Dim l As Integer Dim k As Integer Dim j As Integer Dim ff As Integer Dim ll As Integer Dim temp As Single ff = 1 ll = 6 For i = 3 To numofrows temp = 0 Arr(1) = Cells(i, arxi) Arr(2) = Cells(i, arxi + per) Arr(3) = Cells(i, arxi + (per * 2)) Arr(4) = Cells(i, arxi + (per * 3)) Arr(5) = Cells(i, arxi + (per * 4)) Arr(6) = Cells(i, arxi + (per * 5)) For k = ff To ll - 1 For j = k + 1 To ll If Arr(k) &gt; Arr(j) Then temp = Arr(j) Arr(j) = Arr(k) Arr(k) = temp End If Next j Next k '''''''''''''''''''' For l = arxi To arxi + (per * 5) Step per If Cells(i, l) = Arr(1) And Cells(i, l) &gt;= 0 Then Call xromatismos_keliou(i, l, 6) ElseIf Cells(i, l) = Arr(2) And Cells(i, l) &gt;= 0 Then Call xromatismos_keliou(i, l, 5) ElseIf Cells(i, l) = Arr(3) And Cells(i, l) &gt;= 0 Then Call xromatismos_keliou(i, l, 4) ElseIf Cells(i, l) = Arr(4) And Cells(i, l) &gt;= 0 Then Call xromatismos_keliou(i, l, 3) ElseIf Cells(i, l) = Arr(5) And Cells(i, l) &gt;= 0 Then Call xromatismos_keliou(i, l, 2) ElseIf Cells(i, l) = Arr(6) And Cells(i, l) &gt;= 0 Then Call xromatismos_keliou(i, l, 1) ElseIf Cells(i, l) = Arr(1) And Cells(i, l) &lt; 0 Then Call xromatismos_keliou(i, l, 6) ElseIf Cells(i, l) = Arr(2) And Cells(i, l) &lt; 0 Then Call xromatismos_keliou(i, l, 5) ElseIf Cells(i, l) = Arr(3) And Cells(i, l) &lt; 0 Then Call xromatismos_keliou(i, l, 4) ElseIf Cells(i, l) = Arr(4) And Cells(i, l) &lt; 0 Then Call xromatismos_keliou(i, l, 3) ElseIf Cells(i, l) = Arr(5) And Cells(i, l) &lt; 0 Then Call xromatismos_keliou(i, l, 2) ElseIf Cells(i, l) = Arr(6) And Cells(i, l) &lt; 0 Then Call xromatismos_keliou(i, l, 1) End If Next l Next i Call addindex(numofrows + 2) Application.Goto Reference:=Range("a1"), Scroll:=True End Sub Sub xromatismos_keliou(row As Integer, col As Integer, bathmos As Integer) If bathmos = 1 Then Cells(row, col).Interior.ColorIndex = 10 ElseIf bathmos = 2 Then Cells(row, col).Interior.ColorIndex = 50 ElseIf bathmos = 3 Then Cells(row, col).Interior.ColorIndex = 43 ElseIf bathmos = 4 Then Cells(row, col).Interior.ColorIndex = 44 ElseIf bathmos = 5 Then Cells(row, col).Interior.ColorIndex = 45 ElseIf bathmos = 6 Then Cells(row, col).Interior.ColorIndex = 46 Cells(row, col).Select With Selection.Font .Bold = True End With Else End If End Sub Sub addindex(thesi As Integer) Cells(thesi, 1).Interior.ColorIndex = 10 Cells(thesi, 1).Value = "1" Cells(thesi, 2).Interior.ColorIndex = 50 Cells(thesi, 2).Value = "2" Cells(thesi, 3).Interior.ColorIndex = 43 Cells(thesi, 3).Value = "3" Cells(thesi, 4).Interior.ColorIndex = 44 Cells(thesi, 4).Value = "4" Cells(thesi, 5).Interior.ColorIndex = 45 Cells(thesi, 5).Value = "5" Cells(thesi, 6).Interior.ColorIndex = 46 Cells(thesi, 6).Value = "6" End Sub </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload