Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
Privacywetgeving
Het is bij Helpmij.nl niet toegestaan om persoonsgegevens in een voorbeeld te plaatsen. Alle voorbeelden die persoonsgegevens bevatten zullen zonder opgaaf van reden verwijderd worden. In de vraag zal specifiek vermeld moeten worden dat het om fictieve namen gaat.
Sub ImporteerImportBestand()
Dim strFile As String
Dim dialog As FileDialog
Dim selectedFile As String
' Open file dialog to select the day file
Set dialog = Application.FileDialog(msoFileDialogFilePicker)
With dialog
.Title = "Selecteer Importbestand"
.Filters.Add "Importbestand", "*.xls*", 1
.InitialFileName = ThisWorkbook.Path
.AllowMultiSelect = False
' Show the dialog and check if a file was selected
If .Show = -1 Then ' If a file is selected
selectedFile = .SelectedItems(1)
strFile = selectedFile
Else ' If no file is selected
MsgBox "Geen Importbestand geselecteerd"
Exit Sub
End If
End With
' Open the selected file and copy the first sheet to this workbook
Workbooks.Open selectedFile
ActiveWorkbook.Sheets("Prestaties").Select
ActiveWorkbook.ActiveSheet.Range("C5;C7;C11:C16;C29;C52;C47:E60;E67:E82;C55:C138;N9;N35;Y4").Select
Selection.Copy
ThisWorkbook.Sheets("Prestaties").Range("C5").Select
Selection.Paste
ActiveWorkbook.Sheets("Transacties").Select
ActiveWorkbook.ActiveSheet.Range("B8:T10000").Select
Selection.Copy
ThisWorkbook.Sheets("Transacties").Range("B8").Select
Selection.Paste
ActiveWorkbook.Sheets("Prestaties").Select
' Close the imported workbook without saving
On Error Resume Next
Workbooks(selectedFile).Close savechanges:=False
On Error GoTo 0 ' Reset error handling
End Sub
Workbooks.Open selectedFile
With ActiveWorkbook
.Sheets("Prestaties").Range("C5;C7;C11:C16;C29;C52;C47:E60;E67:E82;C55:C138;N9;N35;Y4").Copy ThisWorkbook.Sheets("Prestaties").Range("C5")
.Sheets("Transacties").Range("B8:T10000").Copy ThisWorkbook.Sheets("Transacties").Range("B8")
Application.Goto .Sheets("Prestaties").Range("A1"), True
End With
' Close the imported workbook without saving
On Error Resume Next
selectedFile = CreateObject("scripting.filesystemobject").getfilename(selectedFile)
Workbooks(selectedFile).Close savechanges:=False
On Error GoTo 0 ' Reset error handlin
Sub ImporteerImportBestand()
Dim strFile As String
Dim dialog As FileDialog
Dim selectedFile As String
' Open file dialog to select the day file
Set dialog = Application.FileDialog(msoFileDialogFilePicker)
With dialog
.Title = "Selecteer Importbestand"
.Filters.Add "Importbestand", "*.xls*", 1
.InitialFileName = ThisWorkbook.Path
.AllowMultiSelect = False
' Show the dialog and check if a file was selected
If .Show = -1 Then ' If a file is selected
selectedFile = .SelectedItems(1)
strFile = selectedFile
Else ' If no file is selected
MsgBox "Geen Importbestand geselecteerd"
Exit Sub
End If
End With
' Open the selected file and copy the first sheet to this workbook
Workbooks.Open selectedFile
ActiveWorkbook.Sheets("Prestaties").Select
ActiveWorkbook.ActiveSheet.Range("C5").Select
Selection.Copy
ThisWorkbook.Sheets("Prestaties").Range("C5").Select
' Close the imported workbook without saving
On Error Resume Next
Workbooks(selectedFile).Close savechanges:=False
On Error GoTo 0 ' Reset error handling
End Sub
Sub ImporteerDagbestand()
Dim selectedFile As String, rngArr, i As Long
' Open file dialog to select the day file
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Selecteer dagbestand"
.Filters.Add "Dagbestand", "*.xls*", 1
.InitialFileName = ThisWorkbook.Path
.AllowMultiSelect = False
' Show the dialog and check if a file was selected
If .Show = -1 Then ' If a file is selected
selectedFile = .SelectedItems(1)
Else ' If no file is selected
MsgBox "Geen dagbestand geselecteerd"
Exit Sub
End If
End With
' Open the selected file and copy the first sheet to this workbook
rngArr = Split("C5;C7;C11:C16;C29;C52;C47:E60;E67:E82;C55:C138;N9;N35;Y4", ";")
Workbooks.Open selectedFile
With ActiveWorkbook
For i = 0 To UBound(rngArr)
ThisWorkbook.Sheets("Prestaties").Range(rngArr(i)).Value = .Sheets("Prestaties").Range(rngArr(i)).Value
Next
.Sheets("Transacties").Range("B8:T10000").Copy ThisWorkbook.Sheets("Transacties").Range("B8")
Application.Goto .Sheets("Prestaties").Range("A1"), True
End With
' Close the imported workbook without saving
On Error Resume Next
selectedFile = CreateObject("scripting.filesystemobject").getfilename(selectedFile)
Workbooks(selectedFile).Close False
On Error GoTo 0 ' Reset error handling
End Sub
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.