question simple de variabilisation

xorre

XLDnaute Junior
Bonjour, en passant par l'enregistreur j'ai sorti une macro du genre :

Code:
Sub Importation()
'
' Importation Macro
' test importation + mise en forme
'
'
    With ActiveSheet.QueryTables.Add(Connection:= _
        "TEXT;C:\XXX\YY\Z" _
        , Destination:=Range("$B$2"))
        .Name = "XXX"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 850
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = True
        .TextFileCommaDelimiter = False
        .TextFileSpaceDelimiter = False
        .TextFileColumnDataTypes = Array(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, _
        2, 2, 2, 2, 2, 2, 2, 2, 2)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
    ActiveWindow.SmallScroll Down:=-12
End Sub
Je suis en train de "déblayer" un peu tous les .Textfile pour mieux comprendre :)

Comment faire pour variabiliser le fichier sélectionné via sélection popup comme sous windows et de sélectionner la feuille dans laquelle j'ai envie de copier le texte ??

merci d'avance pour votre aide
 

Statistiques des forums

Discussions
312 336
Messages
2 087 389
Membres
103 534
dernier inscrit
Kalamymustapha