OVH Cloud OVH Cloud

Errur 1004

2 réponses
Avatar
JPMonnier
Bonjour,
Je bloque sur cette procédure
Sub RecherchMax
For Each n In Range("a2:a1000")
If n = "P17" Then
If n.Offset(1, 2) = 19 And n.Offset(1, 4) = 133 Then
'********** blocage ligne ci-dessous ***************
Set tab10 = Range(Cells(n.Offset(11, 17)), (Cells(n.Offset(11,
14))))
Set Plage = Union(tab10, tab10)
MsgBox Application.WorksheetFunction.Max(Plage)
End If
End If
Next
Quelqu'un a-til une idée
Merci davance

2 réponses

Avatar
Fredo P.
Si G bien compris.
"Sub RecherchMax()
For Each n In Range("a2:a1000")
If n = "P17" Then
If n.Offset(1, 2) = 19 And n.Offset(1, 4) = 133 Then
'********** blocage ligne ci-dessous ***************
Set Plage = Range(n.Offset(11, 14).Address & ":" & n.Offset(11,
17).Address)

MsgBox Application.WorksheetFunction.Max(Plage)
End If
End If
Next
End Sub
Sub RecherchMax
For Each n In Range("a2:a1000")
If n = "P17" Then
If n.Offset(1, 2) = 19 And n.Offset(1, 4) = 133 Then
'********** blocage ligne ci-dessous ***************
Set tab10 = Range(Cells(n.Offset(11, 17)), (Cells(n.Offset(11,
14))))
Set Plage = Union(tab10, tab10) '
§§§§§§§§§§§(Union(Tab10,tab10)=non sens =unir une personne à elle même.)
MsgBox Application.WorksheetFunction.Max(Plage)
End If
End If
Next
Quelqu'un a-til une idée
Merci davance


Avatar
JPMonnier
Bonjour Fredo,
Ok sur union !
Ca marche Nickel
Merci pour ton aide et la rapidité de ta réponse
--
Cordialement

--

"Fredo P." a écrit dans le message de
news:
Si G bien compris.
"Sub RecherchMax()
For Each n In Range("a2:a1000")
If n = "P17" Then
If n.Offset(1, 2) = 19 And n.Offset(1, 4) = 133 Then
'********** blocage ligne ci-dessous ***************
Set Plage = Range(n.Offset(11, 14).Address & ":" & n.Offset(11,
17).Address)

MsgBox Application.WorksheetFunction.Max(Plage)
End If
End If
Next
End Sub
Sub RecherchMax
For Each n In Range("a2:a1000")
If n = "P17" Then
If n.Offset(1, 2) = 19 And n.Offset(1, 4) = 133 Then
'********** blocage ligne ci-dessous ***************
Set tab10 = Range(Cells(n.Offset(11, 17)), (Cells(n.Offset(11,
14))))
Set Plage = Union(tab10, tab10) '
§§§§§§§§§§§(Union(Tab10,tab10)=non sens =unir une personne à elle même.)
MsgBox Application.WorksheetFunction.Max(Plage)
End If
End If
Next
Quelqu'un a-til une idée
Merci davance