Bonjour à tous,

J'ai un tableau Excel qui se remplit via un bouton Access. Je souhaiterai supprimer des lignes du tableau excel si elles ne sont pas remplies. Pouvez-vous m'aider pour modifier le code ci-dessous, svp ?

Ci-dessous le code qui alimente le tableau :
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
 
Dim xlApp            As EXCEL.Application
 Dim xlBook           As EXCEL.Workbook
 Dim xlSheet          As EXCEL.Worksheet
 Dim sSql As String
 Dim rst As New ADODB.Recordset
 
 Dim oApp As EXCEL.Application
 Set oApp = New EXCEL.Application
 Dim oS As EXCEL.Worksheet
 
    sSql = "R_production"
...
rst.Open sSql, CurrentProject.Connection, adOpenStatic
...
With oApp.Workbooks(1)
    .Worksheets("Feuil1").Range("A8", "I35").ClearContents
    .Save
    .Close
End With
...
With xlSheet
            .Cells(8, 1).CopyFromRecordset rst "
        End With
...
rst.Close
...
Set rst = Nothing
...
Set xlSheet = Nothing
        Set xlBook = Nothing
        Set xlApp = Nothing
Le tableau Excel à la base est créé avec 20 lignes mais souvent après l'importation seulement quelques lignes sont remplies dons je voudrai supprimer toutes les lignes vides qui ne servent à rien.
Merci d'avance pour vos retours,

Amicalement
Mamanhou