Bonjour je souhaiterai utilisé une fonction dejà existante en changeant quelque donné tel que les colonnes ou autre mais le probleme c'est que je n'arrive pas a la renommer, voir ci dessous
J'utilise cette fonction en ecrivant dans la cellule =findplan()
Function findplan(numdevis)
Dim DerLig As Long, Lig As Long, VPlan As String
findplan = ""
With Sheets("Feuil2")
DerLig = .Range("A" & Rows.Count).End(xlUp).Row
For Lig = 2 To DerLig
VPlan = .Range("A" & Lig).Value
' Vérifier si le devis du plan correspond à la recherche
If CStr(.Range("B" & Lig)) = numdevis Then
findplan = findplan & VPlan & " " & "/" & " "
End If
Next Lig
End With
If Len(findplan) > 0 Then
' Enlever la dernière virgule
findplan = Left(findplan, Len(findplan) - 1)
End If
End Function
2eme fonction
Je voudrai l'utiliser en écrivant =findplan2 ()
Function findplan2(numdossier)
Dim DerLig As Long, Lig As Long, VPlan As String
findplan2 = ""
With Sheets("Feuil2")
DerLig = .Range("A" & Rows.Count).End(xlUp).Row
For Lig = 2 To DerLig
VPlan = .Range("A" & Lig).Value
' Vérifier si le devis du plan correspond à la recherche
If CStr(.Range("B" & Lig)) = numdevis Then
findplan2 = findplan2 & VPlan & " " & "/" & " "
End If
Next Lig
End With
If Len(findplan2) > 0 Then
' Enlever la dernière virgule
findplan2 = Left(findplan2, Len(findplan2) - 1)
End If
End Function
Lorsque j'ecris cela il ne reconnait pas la fonction
je ne sais pas du tout si ce que j'ai fais renomme la fonction , je ne pense aps d'ailleurs étant donné que cela ne fonctionne pas
Merci a vous
J'utilise cette fonction en ecrivant dans la cellule =findplan()
Function findplan(numdevis)
Dim DerLig As Long, Lig As Long, VPlan As String
findplan = ""
With Sheets("Feuil2")
DerLig = .Range("A" & Rows.Count).End(xlUp).Row
For Lig = 2 To DerLig
VPlan = .Range("A" & Lig).Value
' Vérifier si le devis du plan correspond à la recherche
If CStr(.Range("B" & Lig)) = numdevis Then
findplan = findplan & VPlan & " " & "/" & " "
End If
Next Lig
End With
If Len(findplan) > 0 Then
' Enlever la dernière virgule
findplan = Left(findplan, Len(findplan) - 1)
End If
End Function
2eme fonction
Je voudrai l'utiliser en écrivant =findplan2 ()
Function findplan2(numdossier)
Dim DerLig As Long, Lig As Long, VPlan As String
findplan2 = ""
With Sheets("Feuil2")
DerLig = .Range("A" & Rows.Count).End(xlUp).Row
For Lig = 2 To DerLig
VPlan = .Range("A" & Lig).Value
' Vérifier si le devis du plan correspond à la recherche
If CStr(.Range("B" & Lig)) = numdevis Then
findplan2 = findplan2 & VPlan & " " & "/" & " "
End If
Next Lig
End With
If Len(findplan2) > 0 Then
' Enlever la dernière virgule
findplan2 = Left(findplan2, Len(findplan2) - 1)
End If
End Function
Lorsque j'ecris cela il ne reconnait pas la fonction
je ne sais pas du tout si ce que j'ai fais renomme la fonction , je ne pense aps d'ailleurs étant donné que cela ne fonctionne pas
Merci a vous