Ik wil van een workbook 7 bestanden willen maken om later samen te voegen en te vergelijken.
Ik zou ook maar eenmalig willen kiezen in welk path ik het wil opslagen
Ik heb volgende code gemaakt maar het werkt niet:
Ik zou ook maar eenmalig willen kiezen in welk path ik het wil opslagen
Ik heb volgende code gemaakt maar het werkt niet:
Code:
Sub BestandenMaken()
Dim FileFormatValue As Long
Dim Tornooi As String, MasterFile As String, Poule1File As String, Poule2File As String, Poule3File As String, Poule4File As String, Poule5File As String, Poule6File As String
Tornooi = Sheets("START").Range("D3").Value
MasterFile = "C:\Documents and Settings\My Documents\VAS\Master"" " & Tornooi & ".xlsm"
Poule1File = "C:\Documents and Settings\My Documents\VAS\Poule1"" " & Tornooi & ".xlsm"
Poule2File = "C:\Documents and Settings\My Documents\VAS\Poule2"" " & Tornooi & ".xlsm"
Poule3File = "C:\Documents and Settings\My Documents\VAS\Poule3"" " & Tornooi & ".xlsm"
Poule4File = "C:\Documents and Settings\My Documents\VAS\Poule4"" " & Tornooi & ".xlsm"
Poule5File = "C:\Documents and Settings\My Documents\VAS\Poule5"" " & Tornooi & ".xlsm"
Poule6File = "C:\Documents and Settings\My Documents\VAS\Poule6"" " & Tornooi & ".xlsm"
ActiveWorkbook.SaveAs Filename:=MasterFile, FileFormat:=FileFormatValue = 52, CreateBackup:=False
If ActiveSheet.Range("C10").Value = "" Then GoTo poule2:
ActiveWorkbook.SaveAs Filename:=Poule1File, FileFormat:=FileFormatValue = 52, CreateBackup:=False
poule2:
If ActiveSheet.Range("D10").Value = "" Then GoTo poule3:
ActiveWorkbook.SaveAs Filename:=Poule2File, FileFormat:=FileFormatValue = 52, CreateBackup:=False
poule3:
If ActiveSheet.Range("E10").Value = "" Then GoTo poule4:
ActiveWorkbook.SaveAs Filename:=Poule3File, FileFormat:=FileFormatValue = 52, CreateBackup:=False
poule4:
If ActiveSheet.Range("F10").Value = "" Then GoTo poule5:
ActiveWorkbook.SaveAs Filename:=Poule4File, FileFormat:=FileFormatValue = 52, CreateBackup:=False
poule5:
If ActiveSheet.Range("G10").Value = "" Then GoTo poule6:
ActiveWorkbook.SaveAs Filename:=Poule5File, FileFormat:=FileFormatValue = 52, CreateBackup:=False
poule6:
If ActiveSheet.Range("H10").Value = "" Then Exit Sub
ActiveWorkbook.SaveAs Filename:=Poule6File, FileFormat:=FileFormatValue = 52, CreateBackup:=False
End Sub
Laatst bewerkt: