I have a code to save the worksheet in multiple spots---that was the code that took me a while to get right since the folder name is referenced in cells, and it works like a charm.
But the easier part of the code--the simple closing the workbook when done--won't work. It's always sad when the little, easy things don't run. :P
It will save the workbook in all those locations, but it will not clise the workbook.
But the easier part of the code--the simple closing the workbook when done--won't work. It's always sad when the little, easy things don't run. :P
It will save the workbook in all those locations, but it will not clise the workbook.
Code:
strName = Sheet1.Range("F1")
ActiveWorkbook.SaveAs Filename:="C:\Users\Katie\Desktop\" & Sheet1.Range("E6") & "\ " & strName
ActiveWorkbook.SaveAs Filename:="C:\Users\Katie\Desktop\AI Teachers\" & Sheet1.Range("E10") & "\" & Sheet2.Range("B2") & "\" & strName
If Sheet1.Range("E12") = "" Then
Exit Sub
Else
ActiveWorkbook.SaveAs Filename:="C:\Users\Katie\Desktop\AI Program\AI Teachers\" & Sheet1.Range("E12") & "\" & Sheet2.Range("B2") & "\" & strName
If Sheet1.Range("E14") = "" Then
Exit Sub
Else
ActiveWorkbook.SaveAs Filename:="C:\Users\Katie\Desktop\AI Program\AI Teachers\" & Sheet1.Range("E14") & "\" & Sheet2.Range("B2") & "\" & strName
If Sheet1.Range("E16") = "" Then
Exit Sub
Else
ActiveWorkbook.SaveAs Filename:="C:\Users\Katie\Desktop\AI Program\AI Teachers\" & Sheet1.Range("E16") & "\" & Sheet2.Range("B2") & "\" & strName
End If
End If
End If
ActiveWorkbook.Close
'I also tried ThisWorkbook.Close with no luck either
Exit Sub