Hoi allemaal,
Ik heb een korte vraag.
Bij het maken van een rapportage heet het bestand ''turfanalyse lijn 2 26-06-2013_04-23''
Voor het samenvoegen werkt mijn formule als ik in de 2e rode regel ''turfanalyse lijn 2 26-06-2013'', maar ik wil de datum dynamisch hebben, daarum staat bij de eerste regel dat hij verwijst naar een cel in het blad, in deze cel staat de formule =Today()-1
Hij pakt die data wel uit de cel, want bij het opslaan voegt hij de datum bij uit de regel van ''da''.
Maar hoe plaats ik de Da in de 2e regel zodat hij da mee leest als titel???
Sub CollectAll_Click()
On Error Resume Next
Application.DisplayAlerts = False
Application.EnableEvents = False
Dim fso, da, fld, fil As Object
Dim wb As Workbook
Dim ws As Worksheet
Dim Sh As String
Dim astrLinks As Variant
Set fso = CreateObject("Scripting.FileSystemObject")
da = Sheets("Resultaat").Range("T2")
Sh = Format(da, "dd mmm")
Ma = Format(da, "mm")
Best = Ma & " Pressco Analyse L2 - " & Sh & ".xlsx"
Dest = "C:\Documents and Settings\RvanHaar\My Documents\Importeren in dagrapportage\"
Application.ScreenUpdating = False
Set fld = fso.GetFolder(Dest)
For Each fil In fld.Files
If LCase(Left(fil.Name, 26)) = "turflijst lijn2" & da Then
Set wb = Workbooks.Open(fil.Path)
Set ws = wb.Sheets(1)
With PressCollect
With wb.VBProject
awcl = .VBComponents(ws.CodeName).CodeModule.CountOfLines
.VBComponents(ws.CodeName).CodeModule.DeleteLines 1, awcl
Ik heb een korte vraag.
Bij het maken van een rapportage heet het bestand ''turfanalyse lijn 2 26-06-2013_04-23''
Voor het samenvoegen werkt mijn formule als ik in de 2e rode regel ''turfanalyse lijn 2 26-06-2013'', maar ik wil de datum dynamisch hebben, daarum staat bij de eerste regel dat hij verwijst naar een cel in het blad, in deze cel staat de formule =Today()-1
Hij pakt die data wel uit de cel, want bij het opslaan voegt hij de datum bij uit de regel van ''da''.
Maar hoe plaats ik de Da in de 2e regel zodat hij da mee leest als titel???
Sub CollectAll_Click()
On Error Resume Next
Application.DisplayAlerts = False
Application.EnableEvents = False
Dim fso, da, fld, fil As Object
Dim wb As Workbook
Dim ws As Worksheet
Dim Sh As String
Dim astrLinks As Variant
Set fso = CreateObject("Scripting.FileSystemObject")
da = Sheets("Resultaat").Range("T2")
Sh = Format(da, "dd mmm")
Ma = Format(da, "mm")
Best = Ma & " Pressco Analyse L2 - " & Sh & ".xlsx"
Dest = "C:\Documents and Settings\RvanHaar\My Documents\Importeren in dagrapportage\"
Application.ScreenUpdating = False
Set fld = fso.GetFolder(Dest)
For Each fil In fld.Files
If LCase(Left(fil.Name, 26)) = "turflijst lijn2" & da Then
Set wb = Workbooks.Open(fil.Path)
Set ws = wb.Sheets(1)
With PressCollect
With wb.VBProject
awcl = .VBComponents(ws.CodeName).CodeModule.CountOfLines
.VBComponents(ws.CodeName).CodeModule.DeleteLines 1, awcl