Moderatori: Anthony47, Flash30005
Sub Colora()
Worksheets("ENALOTTO").Range("C8:H65536").Interior.ColorIndex = xlNone
RigaIni = Worksheets("ENALOTTO").Range("B1").Value - 5
RigaFine = Worksheets("ENALOTTO").Range("A" & Rows.Count).End(xlUp).Row
If RigaIni < 8 Then
MsgBox "Numero Riga troppo basso"
Exit Sub
End If
ColIni = 15
ColFine = Worksheets("ENALOTTO").Cells(1, Columns.Count).End(xlToLeft).Column
Dim VCol(6) As Integer
VCol(1) = 34
VCol(2) = 35
VCol(3) = 36
VCol(4) = 38
VCol(5) = 37
VCol(6) = 3
For RR1 = RigaIni To RigaFine
MyC = Evaluate("=SUM(COUNTIF(ENALOTTO!C" & RR1 & ":H" & RR1 & ",ENALOTTO!O1:IV1))")
If MyC > 0 Then
Tr = 0
Col = VCol(MyC)
For CCT = ColIni To ColFine
V1 = Worksheets("ENALOTTO").Cells(1, CCT).Value
For CC1 = 3 To 8
If Worksheets("ENALOTTO").Cells(RR1, CC1).Value = V1 Then
Tr = Tr + 1
Worksheets("ENALOTTO").Cells(RR1, CC1).Interior.ColorIndex = Col
If Tr >= MyC Then GoTo SaltaRR1
End If
Next CC1
Next CCT
End If
SaltaRR1:
Next RR1
End Sub
Exit Sub '<<< esistente
End If '<<< esistente
Application.ScreenUpdating = False '<<< aggiungere
Application.Calculation = xlManual '<<< aggiungere
ColIni = 15 '<<< esistente
Next RR1 '<<< esistente
Application.Calculation = xlCalculationAutomatic '<<< aggiungere
Application.ScreenUpdating = True '<<< aggiungere
End Sub '<<< esistente
Sub Colora2()
RigaIni = Worksheets("ENALOTTO").Range("B1").Value - 5
RigaFine = Worksheets("ENALOTTO").Range("A" & Rows.Count).End(xlUp).Row
If RigaIni < 8 Then
MsgBox "Numero Riga troppo basso"
Exit Sub
End If
Worksheets("ENALOTTO").Range("C8:H65536").Interior.ColorIndex = xlNone
Worksheets("ENALOTTO").Range("O2:O7").ClearContents '<<< aggiunta per pulizia totali in O2:O7
Application.ScreenUpdating = False
Application.Calculation = xlManual
ColIni = 15
ColFine = Worksheets("ENALOTTO").Cells(1, Columns.Count).End(xlToLeft).Column
Dim VCol(6) As Integer
VCol(1) = 34
VCol(2) = 35
VCol(3) = 36
VCol(4) = 38
VCol(5) = 37
VCol(6) = 3
For RR1 = RigaIni To RigaFine
MyC = Evaluate("=SUM(COUNTIF(ENALOTTO!C" & RR1 & ":H" & RR1 & ",ENALOTTO!O1:IV1))")
If MyC > 0 Then
Worksheets("ENALOTTO").Cells(MyC + 1, 15).Value = Worksheets("ENALOTTO").Cells(MyC + 1, 15).Value + 1 '<<<< aggiunta per conteggio frequenze
Tr = 0
Col = VCol(MyC)
For CCT = ColIni To ColFine
V1 = Worksheets("ENALOTTO").Cells(1, CCT).Value
For CC1 = 3 To 8
If Worksheets("ENALOTTO").Cells(RR1, CC1).Value = V1 Then
Tr = Tr + 1
Worksheets("ENALOTTO").Cells(RR1, CC1).Interior.ColorIndex = Col
If Tr >= MyC Then GoTo SaltaRR1
End If
Next CC1
Next CCT
End If
SaltaRR1:
Next RR1
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$B$1" Then Exit Sub
Call Colora2
End Sub
Sub Colora2()
RigaIni = Worksheets("ENALOTTO").Range("B1").Value - 5
RigaFine = Worksheets("ENALOTTO").Range("A" & Rows.Count).End(xlUp).Row
If RigaIni < 8 Then
MsgBox "Numero Riga troppo basso"
Exit Sub
End If
Worksheets("ENALOTTO").Range("C8:H65536").Interior.ColorIndex = xlNone
Worksheets("ENALOTTO").Range("M1:M7").ClearContents
Application.ScreenUpdating = False
Application.Calculation = xlManual
Worksheets("ENALOTTO").Range("M1").Value = "Freq"
ColIni = 15
ColFine = Worksheets("ENALOTTO").Cells(1, Columns.Count).End(xlToLeft).Column
Worksheets("ENALOTTO").Range("O2:IV7").ClearContents
Dim VCol(6) As Integer
VCol(1) = 34
VCol(2) = 35
VCol(3) = 36
VCol(4) = 38
VCol(5) = 37
VCol(6) = 3
For RR1 = RigaIni To RigaFine
MyC = Evaluate("=SUM(COUNTIF(ENALOTTO!C" & RR1 & ":H" & RR1 & ",ENALOTTO!O1:IV1))")
If MyC > 0 Then
Worksheets("ENALOTTO").Cells(MyC + 1, 13).Value = Worksheets("ENALOTTO").Cells(MyC + 1, 13).Value + 1
Tr = 0
Col = VCol(MyC)
For CCT = ColIni To ColFine
V1 = Worksheets("ENALOTTO").Cells(1, CCT).Value
For CC1 = 3 To 8
If Worksheets("ENALOTTO").Cells(RR1, CC1).Value = V1 Then
Worksheets("ENALOTTO").Cells(MyC + 1, CCT).Value = Worksheets("ENALOTTO").Cells(MyC + 1, CCT).Value + 1
Tr = Tr + 1
Worksheets("ENALOTTO").Cells(RR1, CC1).Interior.ColorIndex = Col
If Tr >= MyC Then GoTo SaltaRR1
End If
Next CC1
Next CCT
End If
SaltaRR1:
Next RR1
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
MyC = Evaluate("=SUM(COUNTIF(ENALOTTO!C" & RR1 & ":H" & RR1 & ",ENALOTTO!O1:IV1))")
MyC = Evaluate("=SUM(COUNTIF(ENALOTTO!C" & RR1 & ":H" & RR1 & ",ENALOTTO!O1:IV1))")
Range("AA1:AD1").Value = myArray
MyC = Evaluate("=SUM(COUNTIF(B1:H5,AA1:AD1))")
MyC = 0
For I = LBound(myArray, 1) To UBound(myArray, 1)
MyC = MyC + Application.WorksheetFunction.CountIf(Sheets("Foglio1").Range("B1:H5"), myArray(I))
Next I
Torna a Applicazioni Office Windows
colora parte di frase/ Parola in stessa cella Autore: raimea |
Forum: Applicazioni Office Windows Risposte: 6 |
Visitano il forum: Nessuno e 27 ospiti