Moderatori: Anthony47, Flash30005
Sub CompilaCoinc()
Set Ws1 = Worksheets("Foglio1")
Set Ws2 = Worksheets("Foglio2")
UR1 = Ws1.Range("A" & Rows.Count).End(xlUp).Row
UR2 = Ws2.Range("A" & Rows.Count).End(xlUp).Row
If UR2 < 2 Then UR2 = 2
Ws2.Range("A2:C" & UR2).ClearContents
MaxL = 0
For RR1 = 2 To UR1
If Ws1.Range("C" & RR1).Value > MaxL Then MaxL = Ws1.Range("C" & RR1).Value
Next RR1
MLL = 0
For LL = 1 To MaxL
StrL = ""
For RR1 = 2 To UR1
If Ws1.Range("C" & RR1).Value = LL Then
If MLL <> LL Then
URS = Ws2.Range("A" & Rows.Count).End(xlUp).Row + 1
Ws2.Range("A" & URS).Value = LL
Ws2.Range("B" & URS).Value = Ws1.Range("D" & RR1).Value
Ws2.Range("C" & URS).Value = Ws1.Range("A" & RR1).Value
StrL = Ws1.Range("A" & RR1).Value & " "
MLL = LL
Else
StrL = StrL & Ws1.Range("A" & RR1).Value & " "
End If
End If
Next RR1
Ws2.Range("C" & URS).Value = StrL
Next LL
End Sub
Sub CompilaCoinc()
Set Ws1 = Worksheets("Foglio1")
Set Ws2 = Worksheets("Foglio2")
UR1 = Ws1.Range("A" & Rows.Count).End(xlUp).Row
UR2 = Ws2.Range("A" & Rows.Count).End(xlUp).Row
If UR2 < 2 Then UR2 = 2
Ws2.Range("A2:BB" & UR2).ClearContents
MaxL = 0
For RR1 = 2 To UR1
If Ws1.Range("C" & RR1).Value > MaxL Then MaxL = Ws1.Range("C" & RR1).Value
Next RR1
MLL = 0
For LL = 1 To MaxL
For RR1 = 2 To UR1
If Ws1.Range("C" & RR1).Value = LL Then
If MLL <> LL Then
URS = Ws2.Range("A" & Rows.Count).End(xlUp).Row + 1
Ws2.Range("A" & URS).Value = LL
Ws2.Range("B" & URS).Value = Ws1.Range("D" & RR1).Value
Ws2.Range("C" & URS).Value = Ws1.Range("A" & RR1).Value
MLL = LL
Else
UC2 = Ws2.Cells(URS, 200).End(xlToLeft).Column + 1
Ws2.Cells(URS, UC2).Value = Ws1.Range("A" & RR1).Value
End If
End If
Next RR1
Next LL
End Sub
Torna a Applicazioni Office Windows
Inserire add.in nella barra di avvio veloce in excel 2003 Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 4 |
Excel: problema con date se devo unirle a testi Autore: valle1975 |
Forum: Applicazioni Office Windows Risposte: 5 |
confrontare e evidenziare 2 fogli excel Autore: niccia |
Forum: Applicazioni Office Windows Risposte: 7 |
[EXCEL] controllo corrispondenza tra valori con un vincolo Autore: sbs |
Forum: Applicazioni Office Windows Risposte: 9 |
Visitano il forum: Nessuno e 12 ospiti