Hirdetés

Aktív témák

  • picsu

    csendes tag

    válasz picsu #166 üzenetére

    Hát be kell valjjam nem megy ez nekem..... :F
    A kiszedés működik ahogy megcsináltad de a fordítottja nem....
    Mindig olyan verziót tudtam csak csinálni ahol a cél pont a forrás volt....

    Lapa ne légy kegyetlen....

    Sub export()

    Dim elso, masodik, harmadik, negyedik, otodik, hatodik, hetedik As String
    Dim fold As FileDialog
    Dim foldrv As Variant
    Dim fso As Object
    Dim fajllista As FileSearch
    Dim fajllistaindex As Long
    Dim forras, cel As String

    Application.Calculation = xlCalculationManual
    Application.ScreenUpdating = False

    cel = ActiveWindow.Caption

    Set fold = Application.FileDialog(msoFileDialogFolderPicker)

    With fold
    If .Show = -1 Then
    foldrv = .SelectedItems(1)
    Else
    Exit Sub
    End If
    End With

    Set fajllista = Application.FileSearch

    With fajllista
    .NewSearch
    .LookIn = foldrv
    .Filename = ''*.xls''
    .SearchSubFolders = False
    If .Execute > 0 Then
    For fajllistaindex = 1 To .FoundFiles.Count
    'MsgBox .FoundFiles(fajllistaindex)
    Workbooks.Open Filename:=.FoundFiles(fajllistaindex)

    forras = ActiveWindow.Caption


    '
    With Workbooks(forras).Sheets(1)

    Workbooks(cel).Sheets(1).Cells(fajllistaindex + 5, 1) = Workbooks(forras).Sheets(1).Cells(3, 2)


    End With
    '(fajllistaindex, 1) = workbooks(

    Application.DisplayAlerts = False
    Workbooks(forras).Close, savechanges = true
    Application.DisplayAlerts = True

    '''=[Book1.xls]Sheet1!R1C1''
    '''=['' & .FoundFiles(fajllistaindex) & '';]Sheet1!R1C1''

    Next fajllistaindex
    End If
    End With

    Application.ScreenUpdating = True
    Application.Calculation = xlCalculationAutomatic
    Application.Calculate

    MsgBox ''Na ez is megvan mégsincs este... Összesen '' & fajllistaindex & '' fájlból importáltunk adatokat.'', vbInformation + vbOKOnly, ''Komisszióadatok importálása befejeződött''

    End Sub

Aktív témák