Sub CreateSheets()
Dim X As Long
Dim wks As Worksheet
Dim MyFormulas As Variant
Application.ScreenUpdating = False
Application.EnableEvents = False
With Sheets("BOQ")
For X = 5 To .Cells(5, Columns.Count).End(xlToLeft).Column
If Len(.Cells(5, X).Value) > 0 Then
On Error Resume Next
Set wks = Sheets(CStr(.Cells(5, X).Value))
On Error GoTo 0
If wks Is Nothing Then
Sheets("INPUT").Copy after:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = .Cells(5, X).Value
Set wks = ActiveSheet
MyFormulas = Array("='" & wks.Name & "'!$I$65", "", "='" & wks.Name & "'!$I$80", "='" & wks.Name & "'!$I$88", "='" & wks.Name & "'!$I$94", "='" & wks.Name & "'!$I$99", "", "='" & wks.Name & "'!$I$111", "='" & wks.Name & "'!$I$117", "='" & wks.Name & "'!$I$121", "", "='" & wks.Name & "'!$I$127", "='" & wks.Name & "'!$I$132", "='" & wks.Name & "'!$I$134", "='" & wks.Name & "'!$I$135", "='" & wks.Name & "'!$I$138", "='" & wks.Name & "'!$I$141", "='" & wks.Name & "'!$I$144", "", "='" & wks.Name & "'!$I$149", "='" & wks.Name & "'!$I$150", "='" & wks.Name & "'!$I$151", "='" & wks.Name & "'!$I$152", "='" & wks.Name & "'!$I$155", "='" & wks.Name & "'!$I$158", "='" & wks.Name & "'!$I$164", "='" & wks.Name & "'!$I$167", "='" & wks.Name & "'!$I$170", "='" & wks.Name & "'!$I$173", "='" & wks.Name & "'!$I$124", "='" & wks.Name & "'!$I$125", "=1")
.Range("A9").Offset(, X - 1).Resize(32, 1).Formula = Application.Transpose(MyFormulas)
Else
MsgBox "Sheets: " & .Cells(5, X).Value & vbCrLf & vbCrLf & "Already exists!", vbExclamation, "Sheet Exists"
End If
End If
Set wks = Nothing
Next X
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub