XL 2013 Modification code export onglet

Piaf79

XLDnaute Junior
Bonjour à tous,

J'ai dans ma macro export le code suivant :

Option Explicit

Sub Exporter()
Dim s As Object
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheets(Array("ANALYSE")).Copy
With ActiveWorkbook
For Each s In .Sheets: s.DrawingObjects.Delete: Next
.SaveAs ThisWorkbook.Path & "\NS", 51
.Close
End With
ActiveCell.Activate
End Sub


J'ai deux questions :
1. Comment supprimer les validations de données (liste) dans mon export ?
2. Comment remplacer le nom du fichier (ici "NS) par le contenu d'une ou plusieurs cellules ?

Merci pour votre aide.
Bonne journée,

Piaf79
 

job75

XLDnaute Barbatruc
Peux tu m'indiquer où placer "Cells.Validation.Delete " dans mon code ?
Comme plusieurs feuilles peuvent être copiées complétez la macro ainsi :
VB:
Sub Exporter()
Dim w As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheets(Array("ANALYSE")).Copy
With ActiveWorkbook
    For Each w In .Worksheets
        w.DrawingObjects.Delete
        w.Cells.Validation.Delete
    Next
    .SaveAs ThisWorkbook.Path & "\NS", 51
    .Close
End With
End Sub
 

Discussions similaires

Statistiques des forums

Discussions
311 735
Messages
2 082 024
Membres
101 873
dernier inscrit
excellllll