Moderatori: Anthony47, Flash30005
Sub Ritardi()
UR = Worksheets("Foglio1").Range("D" & Rows.Count).End(xlUp).Row
For RR1 = 6 To UR - 1
For RR2 = RR1 + 1 To UR
If Range("D" & RR1).Value = Range("D" & RR2).Value Then
If Range("G" & RR2).Value > Range("G" & RR1).Value Then Range("I" & RR1).Value = Range("G" & RR2).Value - Range("G" & RR1).Value
Exit For
End If
Next RR2
Next RR1
End Sub
Flash30005 ha scritto:Ma lo hai detto tu che volevi solo il primo, indicato con la freccia
spiegati meglio per cortesia
Sub Ritardi()
UR = Worksheets("Foglio1").Range("D" & Rows.Count).End(xlUp).Row
Columns(9).Clear
For RR1 = 6 To UR - 1 Step 100
For RR2 = RR1 + 1 To UR
If Range("D" & RR1).Value = Range("D" & RR2).Value Then
If Range("G" & RR2).Value > Range("G" & RR1).Value Then Range("I" & RR1).Value = Range("G" & RR2).Value - Range("G" & RR1).Value
Exit For
End If
Next RR2
Next RR1
End Sub
Lucio Peruggini ha scritto:Continua a marcare esclusivamente solo l'estrazione 7440, ritardo 15.
Gli altri non li marca.
ciao
Sub Ritardi()
UR = Worksheets("Foglio1").Range("D" & Rows.Count).End(xlUp).Row
Range("I:J").Clear
For RR1 = 6 To UR - 1 Step 100
For RR2 = RR1 + 1 To UR
If Range("D" & RR1).Value = Range("D" & RR2).Value Then
If Range("G" & RR2).Value > Range("G" & RR1).Value Then
Range("I" & RR2).Value = Range("G" & RR2).Value - Range("G" & RR1).Value
Range("J" & RR2).Value = Range("E" & RR2).Value
End If
Exit For
End If
Next RR2
Next RR1
End Sub
Torna a Applicazioni Office Windows
Macro modifica date scelta periodo Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 11 |
Supporto per sviluppo macro VBA Ordinare per data Autore: Carletto Ribolla |
Forum: Applicazioni Office Windows Risposte: 3 |
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 |
Visitano il forum: Nessuno e 16 ospiti