Moderatori: Anthony47, Flash30005
perchè deve contare dall'ultima volta che è uscito supponiamo che il 56 è uscito in C1 contiamo da c2 ...è uscito? no e allora inizia il conteggio 1 vediamo c3 , non è uscito allora 2 ecc ma se in c5 fosse uscito e fosse stata l'ultima volta che è uscito allora ricomincerebbe il conteggio e mi dovrebbe dare 5 esattamente come nell'esempio del 29Anthony47 ha scritto:Illeggibile...
E poi, perche' il ritardo del 56 dovrebbe essere 9?
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim lFor As Object, myMatch
'
Set lFor = Range(Target.Cells(2, 1), Target.Cells(2, 1).End(xlDown))
myMatch = Application.Match(Target.Value, lFor, False)
If IsError(myMatch) Then myMatch = ">" & lFor.Rows.Count
MsgBox ("Ritardo del " & Target.Value & ": " & myMatch)
Cancel = True
End Sub
Sub PapiRow()
Dim I As Long, myMatch
'
For I = 9 To (9 + 24)
Set lFor = Range(Cells(4, I), Cells(4, I).End(xlDown))
myMatch = Application.Match(Cells(3, I).Value, lFor, False)
If IsError(myMatch) Then myMatch = ">" & lFor.Rows.Count
Cells(2, I).Value = "Rit " & Cells(3, I).Value & ": " & myMatch
Next I
End Sub
Anthony47 ha scritto:Non ho capito come vuoi rappresentare i risultati, quindi per ora li mettiamo in Riga2 sopra ogni numero controllato. La macro:
- Codice: Seleziona tutto
Sub PapiRow()
Dim I As Long, myMatch
'
For I = 9 To (9 + 24)
Set lFor = Range(Cells(4, I), Cells(4, I).End(xlDown))
myMatch = Application.Match(Cells(3, I).Value, lFor, False)
If IsError(myMatch) Then myMatch = ">" & lFor.Rows.Count
Cells(2, I).Value = "Rit " & Cells(3, I).Value & ": " & myMatch
Next I
End Sub
Metti il codice in un modulo standard e poi avvia la macro come meglio preferisci
Ciao
Sub PapiRowSel()
Dim I As Long, myMatch, cRow As Long
'
cRow = Selection.Cells(1, 1).Row
Range("I2:AG2").ClearContents
For I = 9 To (9 + 24)
Set lFor = Range(Cells(cRow + 1, I), Cells(cRow + 1, I).End(xlDown))
myMatch = Application.Match(Cells(3, I).Value, lFor, False)
If IsError(myMatch) Then myMatch = ">" & lFor.Rows.Count
Cells(2, I).Value = "Rit " & Cells(cRow, I).Value & ": " & myMatch
Next I
End Sub
Anthony47 ha scritto:Allora:
- Codice: Seleziona tutto
Sub PapiRowSel()
Dim I As Long, myMatch, cRow As Long
'
cRow = Selection.Cells(1, 1).Row
Range("I2:AG2").ClearContents
For I = 9 To (9 + 24)
Set lFor = Range(Cells(cRow + 1, I), Cells(cRow + 1, I).End(xlDown))
[b][color=#FF0000] myMatch = Application.Match(Cells(3, I).Value, lFor, False)[/color][/b]
If IsError(myMatch) Then myMatch = ">" & lFor.Rows.Count
Cells(2, I).Value = "Rit " & Cells(cRow, I).Value & ": " & myMatch
Next I
End Sub
Devi selezionare una cella qualsiasi della riga e avviare la macro
Ciao
Torna a Applicazioni Office Windows
Schermo durante l'avvio resta nero, dopo un pò si accende Autore: lifegate63 |
Forum: Assistenza Hardware Risposte: 2 |
Catalogazione pratiche collegate a pdf con doppio click Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 22 |
Visitano il forum: Nessuno e 6 ospiti