Bonjour à tous,
je tente d'effectuer un USERFORM avec des labels qui prendront les noms indiqués ci-bas.
Par contre, la macro "bug" en arrivant à la fct Match. J'ai cette fonction (identique) dans mon module et AUCUN problème.
Maintenant il me donne comme erreur : "code-13 incompatibilité de type".
PS: nous sommes dans un userform
et j'ai tenté :
1) Application.WorksheetFunctions.Match...
Application.Match
WorksheetFunctions.Match etc...
Avez-vous des suggestions ?
Merci Beaucoup.
Private Sub UserForm_Initialize()
Dim StationID As Variant
Dim Niveau As Variant
Dim DoublonLigne As Integer
StationID = Sheets(1).Range("E5")
Niveau = Sheets("Saisir une donnée").Range("C5")
Sheets(Niveau).Select
DoublonLigne = Application.Match(StationID, Range("D3😀9999"), 0)
'Labels des coordonnées initiales
Label6.Caption = Sheets(Niveau).Range(Cells(DoublonLigne, 5))
Label7.Caption = Sheets(Niveau).Range(Cells(DoublonLigne, 6))
Label8.Caption = Sheets(Niveau).Range(Cells(DoublonLigne, 7))
'Labels des coordonnées de remplacement
Label9.Caption = Sheets("Saisir une donnée").Range("F5")
Label10.Caption = Sheets("Saisir une donnée").Range("G5")
Label11.Caption = Sheets("Saisir une donnée").Range("H5")
End Sub
je tente d'effectuer un USERFORM avec des labels qui prendront les noms indiqués ci-bas.
Par contre, la macro "bug" en arrivant à la fct Match. J'ai cette fonction (identique) dans mon module et AUCUN problème.
Maintenant il me donne comme erreur : "code-13 incompatibilité de type".
PS: nous sommes dans un userform
et j'ai tenté :
1) Application.WorksheetFunctions.Match...
Application.Match
WorksheetFunctions.Match etc...
Avez-vous des suggestions ?
Merci Beaucoup.
Private Sub UserForm_Initialize()
Dim StationID As Variant
Dim Niveau As Variant
Dim DoublonLigne As Integer
StationID = Sheets(1).Range("E5")
Niveau = Sheets("Saisir une donnée").Range("C5")
Sheets(Niveau).Select
DoublonLigne = Application.Match(StationID, Range("D3😀9999"), 0)
'Labels des coordonnées initiales
Label6.Caption = Sheets(Niveau).Range(Cells(DoublonLigne, 5))
Label7.Caption = Sheets(Niveau).Range(Cells(DoublonLigne, 6))
Label8.Caption = Sheets(Niveau).Range(Cells(DoublonLigne, 7))
'Labels des coordonnées de remplacement
Label9.Caption = Sheets("Saisir une donnée").Range("F5")
Label10.Caption = Sheets("Saisir une donnée").Range("G5")
Label11.Caption = Sheets("Saisir une donnée").Range("H5")
End Sub