Alex O
Active Member
- Joined
- Mar 16, 2009
- Messages
- 345
- Office Version
- 365
- Platform
- Windows
I have my code mostly complete - except for a few minor edits that have me stumped! I need all sheets copied to the new workbook except Sheet2 (ODBC_TABLE). If possible, I'd also like no headings and password protected. Any help would be appreciated. Thanks
Code:
Sub New_Syscofile()
Dim Output As Workbook
Dim Current As String
Dim FileName As String
Set Output = ThisWorkbook
Current = ThisWorkbook.FullName
Application.DisplayAlerts = False
Dim SH As Worksheet
For Each SH In Output.Worksheets
SH.UsedRange.Copy
SH.UsedRange.PasteSpecial xlPasteValues, _
Operation:=xlNone, SkipBlanks:=True, Transpose:=False
Next
FileName = ThisWorkbook.Path & "\" & "SYSCO MIDWEST INV" & Format(Date, "mmddyyyy")
Output.SaveAs FileName, XlFileFormat.xlOpenXMLWorkbook
Workbooks.Open Current
Application.DisplayAlerts = True
ActiveWindow.DisplayHeadings = False
ActiveWindow.Zoom = 90
End Sub