Bonjour à tous et à toutes,

J’ai quelques problèmes avec une macro d’Excel (dans le fichier A), la macro doit chercher plusieurs fichiers d’Excel et copier quelques donnes, le problème est que le donnes ne sont pas dans la même colonne et n’ont pas la même quantité de données.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Dim IndiceProduct As Long
    Dim sProduct As String
    Dim IndiceMold As Long
    Dim sMold As String
    Dim IndiceGen As Long
    Dim sGen As String
    Dim IndiceVersion As Long
    Dim sVersion As String
    Dim IndiceFichierProgression As Long
    Dim sFichierProgression As String
    Dim sOeil As String
    Dim IndiceBase As Long
    Dim sBase As String
    Dim IndiceRefBase As Integer
    Dim sRefBase As String
    Dim Base As Integer
    Dim IndiceApp As Long
    Dim sApp As String
    Dim IndiceMarque As Long
    Dim sMarque As String
    Dim NumeroOutil As Long
    Dim NumeroOutillage As Long ' numero outillage (num de base de donnée)
    Dim IndiceTool As Long
    Dim sTool As String
    Dim sRef As String
    Dim IndiceRef As Long
    Dim IndiceVR As Long
    Dim IndiceSite As Integer
    Dim sSite As String
    Dim NumeroSite As Long
    Dim VR As Long
 
    ' on va deja retrouver les colonne clef pour la suite
    sOeil = "S" 'oeil symetrique par defaut
    While sNomColonne <> ""
        IndiceColonne = IndiceColonne + 1
        sNomColonne = UCase(FeuilleXLS.Cells(IndiceLigne, IndiceColonne))
        Select Case sNomColonne
            Case "PRODUCT"
                IndiceProduct = IndiceColonne
            Case "PRODUIT"
                IndiceProduct = IndiceColonne
            Case "MOLD"
                IndiceMold = IndiceColonne
            Case "GEN"
                IndiceGen = IndiceColonne
            Case "VERSION"
                IndiceVersion = IndiceColonne
            Case "SURFACE"
                IndiceFichierProgression = IndiceColonne
            Case "BASE"
                IndiceBase = IndiceColonne
            Case "REFBASE"
                IndiceRefBase = IndiceColonne
            Case "APP"
                IndiceApp = IndiceColonne
            Case "CODE MARQUE"
                IndiceMarque = IndiceColonne
            Case "TOOL #"
                IndiceTool = IndiceColonne
            Case "REF"
                IndiceRef = IndiceColonne
            Case "SITE"
                IndiceSite = IndiceColonne
            Case "VR"
                IndiceVR = IndiceColonne
        End Select
    Wend
Malheureusement elle ne copie pas les donnes dans le fichier « A ».
quelqu'un peut m'aider??