Moderatori: Anthony47, Flash30005
Sub CompilaEv()
Set Ws1 = Worksheets("AMBO TT DA NZ")
URE = Ws1.Range("E" & Rows.Count).End(xlUp).Row
For CC1 = 2 To 10
RangeC = Ws1.Cells(1, CC1).Value
Num1 = Val(Mid(RangeC, 1, InStr(RangeC, "-") - 1))
Num2 = Val(Mid(RangeC, InStr(RangeC, "-") + 1, Len(RangeC) - InStr(RangeC, "-")))
ContaE = 0
For RRE = 6 To URE
If Ws1.Range("E" & RRE).Value >= Num1 And Ws1.Range("E" & RRE).Value <= Num2 Then ContaE = ContaE + 1
Next RRE
Ws1.Cells(4, CC1).Value = ContaE
Next CC1
End Sub
=M1+40
=(M1+1)&"-"&N1
=CONTA.SE($E6:$E50000;"<="&N1)
=CONTA.SE($E6:$E50000;"<="&O1)-SOMMA($B$4:B4)
Lucio Peruggini ha scritto:E possibile poter inserire uno step a piacere e quindi diverso dai multipli?
=CONTA.SE($E6:$E50000;">="&VALORE(STRINGA.ESTRAI(B1;1;TROVA("-";B1)-1)))-CONTA.SE($E6:$E50000;">"&VALORE(STRINGA.ESTRAI(B1;TROVA("-";B1)+1;LUNGHEZZA(B1))))
Anthony47 ha scritto:Se devi cambiare lo stepping in modo dinamico, allora in N1 invece di mettere =M1+40 metterai =M1+$N$2 e copierai poi verso dx; in N2 inserirai il passo voluto che si riflettera' anche sulle intestazioni della tua tabella.
Guarda i messaggi di Flash sopra.
Ciao a tutti.
Sub ContaUnici()
Start = Timer
Application.ScreenUpdating = False
Application.Calculation = xlManual
For FF = 1 To Worksheets.Count
If Len(Sheets(FF).Name) > 2 Then GoTo SaltaFF
Sheets(FF).Select
UR1 = Range("A" & Rows.Count).End(xlUp).Row
Range("CZ18:GK" & UR1).ClearContents
For RR1 = 2 To UR1 - 18 Step 18
For NR = 1 To 90
MyPre = Evaluate("=SUM(COUNTIF(B" & RR1 & ":F" & RR1 + 17 & "," & NR & "))")
If MyPre = 1 Then
UC1 = Cells(RR1 + 17, Columns.Count).End(xlToLeft).Column + 1
If UC1 < 104 Then UC1 = 104
Cells(RR1 + 17, UC1).Value = NR
End If
Next NR
Next RR1
UR2 = Range("CZ" & Rows.Count).End(xlUp).Row
For RR2 = 19 To UR2 Step 18
UC2 = Cells(RR2, Columns.Count).End(xlToLeft).Column
For CC2 = 104 To UC2
NR = Cells(RR2, CC2).Value
MyPre = Evaluate("=SUM(COUNTIF(B" & RR2 + 1 & ":F" & RR2 + 18 & "," & NR & "))")
Cells(RR2 - 1, CC2).Value = MyPre
Next CC2
Next RR2
SaltaFF:
Next FF
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Fine = Timer - Start
MsgBox "Elaborato in " & Int(Fine) & " sec"
End Sub
Flash30005 ha scritto:Sei sicuro di avere l'archivio distribuito così (un foglio per ogni ruota)?
Se così come fai ad aggiornare l'archivio?
Non vorrei che, alla fine, hai l'archivio con tutte le ruote inserite e bisogna rimettere le mani alle macro
ciao
Sub ContaUnici2()
Start = Timer
Application.ScreenUpdating = False
Application.Calculation = xlManual
For FF = 1 To Worksheets.Count
If Len(Sheets(FF).Name) > 2 Then GoTo SaltaFF
Sheets(FF).Select
UR1 = Range("A" & Rows.Count).End(xlUp).Row
Range("CZ18:GK" & UR1).ClearContents
For RR1 = 2 To UR1 - 18 Step 18
For NR = 1 To 90
MyPre = Evaluate("=SUM(COUNTIF(B" & RR1 & ":F" & RR1 + 17 & "," & NR & "))")
If MyPre = 1 Then
UC1 = Cells(RR1 + 17, Columns.Count).End(xlToLeft).Column + 1
If UC1 < 104 Then UC1 = 104
Cells(RR1 + 17, UC1).Value = NR
End If
Next NR
Next RR1
UR2 = Range("CZ" & Rows.Count).End(xlUp).Row
For RR2 = 19 To UR2 Step 18
UC2 = Cells(RR2, Columns.Count).End(xlToLeft).Column
For CC2 = 104 To UC2
NR = Cells(RR2, CC2).Value
MyPre = Evaluate("=SUM(COUNTIF(B" & RR2 + 1 & ":F" & RR2 + 18 & "," & NR & "))")
Cells(RR2 - 1, CC2).Value = MyPre
If MyPre > 0 Then
For RR3 = RR2 + 1 To RR2 + 18
MyPre3 = Evaluate("=SUM(COUNTIF(B" & RR3 & ":F" & RR3 & "," & NR & "))")
If MyPre3 = 1 Then Cells(RR3, NR + 9).Value = NR
Next RR3
End If
Next CC2
Next RR2
SaltaFF:
Next FF
Sheets("BA").Select
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Fine = Timer - Start
MsgBox "Elaborato in " & Int(Fine) & " sec"
End Sub
Torna a Applicazioni Office Windows
Macro che scatta quando cambia dato in un altro file Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 7 |
Modidica Formula Somma I Riferimenti Autore: Francesco6918 |
Forum: Applicazioni Office Windows Risposte: 2 |
Excel: formula automatica per evidenziare prodotto scaduto Autore: gamma_ray |
Forum: Applicazioni Office Windows Risposte: 3 |
Problema con macro copia e rinomina file Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 2 |
formula excel non visualizza risultato Autore: tommasog |
Forum: Applicazioni Office Windows Risposte: 6 |
Visitano il forum: Nessuno e 51 ospiti