Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Alle Exceldateien eines Ordners öffnen

Empfohlene Antworten

Hi,

ich soll ein Makro erstellen und muss dabei alle Exceldateien eines Ordners öffnen, allerdings weiß ich nicht, wie ich diese öffnen kann, denn diese Dateien habe unterschiedliche Namen.

ich hoffe ihr könnt mir helfen.

mfg

Borsti

versuchs mal damit:


Sub DateiOpen()

    Dim Datei As Variant

    With Application.FileSearch

        .NewSearch

        .LookIn = "C:\XXX\"

        .SearchSubFolders = True

        .FileName = "*.dot"

        If .Execute > 0 Then

            For Each Datei In .FoundFiles

                'hier die datei öffnen

            Next

        End If

    End With

End Sub

gruss

versuchs mal damit:


        .FileName = "*.dot"

gruss
würde ich in
        .FileName = "*.xls"

ändern

Hi, danke für eure Hilfe!

@k4fu

da ich den Quelltext ja haben möchte, und ihn versuche zu verstehen, fiel mir das auch auf :)

Aber trotzdem danke für den Hinweis!

Und nun zum aktuellen Code!

Sub DateiOpen()

Dim Datei As Variant

With Application.FileSearch

.NewSearch

.LookIn = "C:\XXX"

.SearchSubFolders = False

.Filename = "*.xls"

If .Execute > 0 Then

For Each Datei In .FoundFiles

'hier die datei öffnen

Workbooks.Open (Datei)

Sheets("bestSheet").Select

Rows("12:18").Select

Selection.Copy

'Workbooks(Datei).Close

Workbooks("DateiDieMakroEnthält").Activate

Sheets("ANSheet").Select

Cells(2, 3).Select.Paste

Next

End If

End With

End Sub

Er meckert mir beim Paste rum, dass ich ein Object angeben soll!

Ist meine Zelle die ich angegeben habe kein Object? Daran scheiterts im Moment noch.

mfg

Borsti

Habe es selber mit:

Cells(Zelle, 1).PasteSpecial Paste:=xlValues

gelöst.

Vielen Danke für euer bemühen!

Borsti

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.