- Codice: Seleziona tutto
=SE(E(B1="Spia";B2="");A2-INDICE(A$1:A1;1+MAX(SE(B$1:B1="Spia";"";RIF.RIGA(B$1:B1))));"")
A questo punto mi chiedo pero' se la formula che ti diedi qualche giorno fa funzionasse realmente...
Ciao
Moderatori: Anthony47, Flash30005
=SE(E(B1="Spia";B2="");A2-INDICE(A$1:A1;1+MAX(SE(B$1:B1="Spia";"";RIF.RIGA(B$1:B1))));"")
Worksheets("Spia_48").Range("E" & RR2).Value = Worksheets("Spia_48").Range("A" & RR2).Value - Conc1
Worksheets("Spia_48").Range("E" & RR1).Value = Worksheets("Spia_48").Range("A" & RR2).Value - Conc1
Anthony47 ha scritto:Nel file allegato questa mi pare che restituisca il valore che cerchi:Contr-Maiusc-Enter
- Codice: Seleziona tutto
=SE(E(B1="Spia";B2="");A2-INDICE(A$1:A1;1+MAX(SE(B$1:B1="Spia";"";RIF.RIGA(B$1:B1))));"")
A questo punto mi chiedo pero' se la formula che ti diedi qualche giorno fa funzionasse realmente...
Ciao
Lucio Peruggini ha scritto:Il ritardo segnato è giusto ma come vedi da immagine, va spostato in giù di una cella.
Worksheets("Spia_48").Range("E" & RR2).Value = Worksheets("Spia_48").Range("A" & RR2).Value - Conc1
Sub TrRit()
UR = Worksheets("Spia_48").Range("A" & Rows.Count).End(xlUp).Row
Worksheets("Spia_48").Columns(5).ClearContents
Worksheets("Spia_48").[E1].Value = "Rit."
Tr = 0
For RR1 = 2 To UR
If Worksheets("Spia_48").Range("B" & RR1).Value = "Spia" And Tr = 0 Then
Conc1 = Worksheets("Spia_48").Range("A" & RR1).Value
For RR2 = RR1 + 1 To RR1 + 50
If Worksheets("Spia_48").Range("B" & RR2).Value = "" Then
Tr = 0
Worksheets("Spia_48").Range("E" & RR2).Value = Worksheets("Spia_48").Range("A" & RR2).Value - Conc1
RR1 = RR2
GoTo SaltaRR2
End If
Next RR2
Tr = 1
SaltaRR2:
End If
Next RR1
End Sub
Sub TrRit()
For F = 1 To Worksheets.Count
UR = Worksheets(F).Range("A" & Rows.Count).End(xlUp).Row
Worksheets(F).Columns(5).ClearContents
Worksheets(F).[E1].Value = "Rit."
Tr = 0
For RR1 = 2 To UR
If Worksheets(F).Range("B" & RR1).Value = "Spia" And Tr = 0 Then
Conc1 = Worksheets(F).Range("A" & RR1).Value
For RR2 = RR1 + 1 To RR1 + 50
If Worksheets(F).Range("B" & RR2).Value = "" Then
Tr = 0
Worksheets(F).Range("E" & RR2).Value = Worksheets(F).Range("A" & RR2).Value - Conc1
RR1 = RR2
GoTo SaltaRR2
End If
Next RR2
Tr = 1
SaltaRR2:
End If
Next RR1
Next F
End Sub
Flash30005 ha scritto:La macro conteggia le righe occupate sulla colonna "A" se si è fermata prima della fine controlla che la colonna A sia completa (fino a 28 mila etc)
ciao
Sub TrRit()
For F = 1 To Worksheets.Count
UR = Worksheets(F).Range("A" & Rows.Count).End(xlUp).Row
Worksheets(F).Columns(5).ClearContents
Worksheets(F).[E1].Value = "Rit."
Tr = 0
For RR1 = 2 To UR
If Worksheets(F).Range("A" & RR2).Value <> "" Then
If Worksheets(F).Range("B" & RR1).Value = "Spia" And Tr = 0 Then
Conc1 = Worksheets(F).Range("A" & RR1).Value
For RR2 = RR1 + 1 To RR1 + 50
If Worksheets(F).Range("B" & RR2).Value = "" Then
Tr = 0
Worksheets(F).Range("E" & RR2).Value = Worksheets(F).Range("A" & RR2).Value - Conc1
RR1 = RR2
GoTo SaltaRR2
End If
Next RR2
Tr = 1
SaltaRR2:
End If
Else
Tr = 0
Endi If
Next RR1
Next F
End Sub
Sub TrRit2()
For F = 1 To Worksheets.Count
UR = Worksheets(F).Range("A" & Rows.Count).End(xlUp).Row
Worksheets(F).Columns(5).ClearContents
Worksheets(F).[E1].Value = "Rit."
Tr = 0
For RR1 = 2 To UR
Foglio = Worksheets(F).Name
If Worksheets(F).Range("A" & RR1).Value <> "" Then
If Worksheets(F).Range("B" & RR1).Value = "Spia" And Tr = 0 Then
Conc1 = Worksheets(F).Range("A" & RR1).Value
For RR2 = RR1 + 1 To RR1 + 50
If Worksheets(F).Range("B" & RR2).Value = "" Then
Tr = 0
Worksheets(F).Range("E" & RR2).Value = Worksheets(F).Range("A" & RR2).Value - Conc1
RR1 = RR2
GoTo SaltaRR2
End If
Next RR2
Tr = 1
SaltaRR2:
End If
Else
Tr = 0
End If
Next RR1
Next F
End Sub
Torna a Applicazioni Office Windows
Macro per aprire file salvato su sharepoint Onedrive Autore: marcopont |
Forum: Applicazioni Office Windows Risposte: 2 |
Come impostare il formato data predefinito in excel? Autore: wallace&gromit |
Forum: Applicazioni Office Windows Risposte: 5 |
Come interrompere macro sndPlaySound Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 2 |
Visitano il forum: Nessuno e 31 ospiti