1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
WTexteAChercher = "NC"
WTrouve = False
WLig_Trouve = 0
Dim OBJ_NC_1 As Object
'cherche l'occurence dans la colonne 1
'''''''''' Set OBJ_NC_1 = Range(Cells(WPremLigSEM, 13), Cells(WDernLigSEM, 13)).Find(WTexteAChercher, LookIn:=xlValues)
With Sheets(P_FeuilleTraficAnnuel)
Set OBJ_NC_1 = .Range(Cells(WPremLigSEM, 13), Cells(WDernLigSEM, 13)).Find(What:=WTexteAChercher, After:=.Range(Cells(WPremLigSEM, 13), Cells(WDernLigSEM, 13)), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=True)
End With
'Si elle est trouvée, renseigne WLig_Trouve avec le N° de ligne
'Si elle n'est pas trouvée => insérer une ligne.
If Not OBJ_NC_1 Is Nothing Then
WTrouve = True
WLig_Trouve = OBJ_NC_1.Row
Else
WTrouve = False
WLig_Trouve = 0
End If
Set OBJ_NC_1 = Nothing |
Partager