ho trovato nel forum questa tua macro che estrae i 20 numeri del 10eLotto da un archivio Lotto,
volevo chiederti se era possibile fare una modifica ,cioè avere i dati del 10eLotto ordinati dal numero più piccolo al più grande,
grazie.
- Codice: Seleziona tutto
Sub Compila()
Dim conta As Integer
Riga1 = Worksheets("Archivio").Range("A" & Rows.Count).End(xlUp).Row
Riga2 = Worksheets("Archivio").Range("BF" & Rows.Count).End(xlUp).Row
For RR = Riga2 + 1 To Riga1
Range("BF" & RR - 1).AutoFill Destination:=Range("BF" & RR - 1 & ":BF" & RR), Type:=xlFillDefault
Agg = 0
conta = 0
Ripeti:
For ColA = 7 To 52 Step 5
TR = 0
ColB = ColA + Agg
If conta >= 20 Then GoTo SaltaRR
Range("BF" & RR).Value = Range("A" & RR).Value
UC = Range("IV" & RR).End(xlToLeft).Column + 1
For CCL = 60 To UC
If Cells(RR, CCL).Value = Cells(RR, ColB) Then
TR = 1
GoTo SaltaCCL
End If
Next CCL
If TR = 0 Then
UCL = Range("IV" & RR).End(xlToLeft).Column + 1
Cells(RR, UCL).Value = Cells(RR, ColB).Value
conta = conta + 1
End If
SaltaCCL:
If ColA = 52 Then
Agg = Agg + 1
GoTo Ripeti
End If
Next ColA
SaltaRR:
Next RR
End Sub