I`ve tried this
Sub test()
Dim newW As Workbook
Application.ScreenUpdating = False
'Application.DisplayAlerts = False
For i = Sheets(1).Range("A50000").End(xlUp).Row To 1 Step -1
Dim A2 As String
A2 = Sheets(1).Cells(i, 1).Value
Dim B2 As String
B2 = Sheets(1).Cells(i, 2).Value
FName = Sheets(1).Cells(i, 1).Value & " " & Sheets(1).Cells(i, 2).Value & ".xls"
Set newW = Workbooks.Add
newW.SaveAs Filename:=FName
With Workbooks(FName)
Workbooks("structure.xls").Worksheets("timetable").Copy Before:=.Sheets(1)
Sheets(1).Cells(2, 1).Value = A2
Sheets(1).Cells(2, 2).Value = B2
.Close
End With
Next
'Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
but the loop ends after the first created workbook and the "display alerts" doesn`t work at all (I know it`s in quote there).
Furthermore, I only copy the value in A2 and B2 of the new sheet but I`d like a formula ; for example "=............" so the cell will reference the main database and will automatically be updated with the main database...
I need your help please....
Bookmarks