1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
Function recup_valeur()
Dim objCell As Range, plageresult As Range
Dim PremAdresse As String, texte_à_chercher As String, PremAdresse2 As String, v As String
texte_à_chercher = "the insertion loss"
With Columns("A:Z").Select
Set objCell = Selection.Find(What:=texte_à_chercher, after:=ActiveCell, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext)
If Not objCell Is Nothing Then
PremAdresse = objCell.Address
Do
If plageresult Is Nothing Then
Set plageresult = objCell
Else
Set plageresult = Application.Union(objCell, plageresult)
End If
Set objCell = Selection.FindNext(objCell)
If Not objCell Is Nothing Then
PremAdresse2 = objCell.Address
recup_ligne = Range(PremAdresse2).Row ' valeur de la ligne ou se trouve information
recup_colonne = Range(PremAdresse2).Column ' valeur de la colonne ou se trouve information
v = Cells(recup_ligne, recup_colonne).Value 'valeur à mettre dans la liste
End If
Loop While Not objCell Is Nothing And objCell.Address <> PremAdresse
End If
recup_ligne = Range(PremAdresse).Row ' valeur de la ligne ou se trouve information
recup_colonne = Range(PremAdresse).Column ' valeur de la colonne ou se trouve information
v = Cells(recup_ligne, recup_colonne).Value 'valeur à mettre dans la liste
End With
End Function |
Partager