T
tracor
Guest
bonjour le phorum
je souhaiterai pouvoir dans une macro ne selectionner que les codes postaux de livraison ne commencant pas par 20 (corse)
voici la macro qui me vient de thierry (encore merci d'ailleurs)
Option Explicit
Option Compare Text
Sub QS()
Dim DateFrom As Date
Dim DateTo As Date
Dim Tableau As Variant
Dim qstransport As Long, a As Long
With Sheets("contrôle QS hebdo")
DateFrom = .Range("B1")
DateTo = .Range("B2")
End With
Tableau = Sheets("données").Range("A1:CB65000") 'à adapter
Application.StatusBar = "QS transport hors Corse"
For a = 1 To UBound(Tableau)
If Tableau(a, 35) >= DateFrom And Tableau(a, 35) <= DateTo Then
If Tableau(a, 14) <> "20*" Then
qstransport = qstransport + 1
End If
End If
Next a
With Sheets("contrôle QS hebdo")
.Range("e7") = qstransport
End With
End Sub
quelle instruction peux me permettre d'exclure les codes postaux commencant par 20
merci d'avance
tracor
je souhaiterai pouvoir dans une macro ne selectionner que les codes postaux de livraison ne commencant pas par 20 (corse)
voici la macro qui me vient de thierry (encore merci d'ailleurs)
Option Explicit
Option Compare Text
Sub QS()
Dim DateFrom As Date
Dim DateTo As Date
Dim Tableau As Variant
Dim qstransport As Long, a As Long
With Sheets("contrôle QS hebdo")
DateFrom = .Range("B1")
DateTo = .Range("B2")
End With
Tableau = Sheets("données").Range("A1:CB65000") 'à adapter
Application.StatusBar = "QS transport hors Corse"
For a = 1 To UBound(Tableau)
If Tableau(a, 35) >= DateFrom And Tableau(a, 35) <= DateTo Then
If Tableau(a, 14) <> "20*" Then
qstransport = qstransport + 1
End If
End If
Next a
With Sheets("contrôle QS hebdo")
.Range("e7") = qstransport
End With
End Sub
quelle instruction peux me permettre d'exclure les codes postaux commencant par 20
merci d'avance
tracor