I was working with the following VBA (attached below). It works great, and what I like the most is that it is Path/Name independent. I am now trying to save multiple reports which are based on some HiddenSheets (very hidden), which I don't want to include. The problem with this Macro is that it creates individual Worksheets for every sheet, including the invisible sheets. Is there a chance to have the whole same concept of creating a folder with the same workbook name but only include the visible sheets? If so, please let me know. I have been trying to tweak this code so much, and it either includes only one sheet or all of them (not the visible only) Thanks!
Sub SaveShtsAsBook() Dim Sheet As Worksheet, SheetName$, MyFilePath$, N& MyFilePath$ = ActiveWorkbook.Path & "\" & _ Left(ThisWorkbook.Name, Len(ThisWorkbook.Name) - 4) With Application .ScreenUpdating = False .DisplayAlerts = False ' End With On Error Resume Next '<< a folder exists MkDir MyFilePath '<< create a folder For N = 1 To Sheets.Count Sheets(N).Activate SheetName = ActiveSheet.Name Cells.Copy Workbooks.Add (xlWBATWorksheet) With ActiveWorkbook With .ActiveSheet .Paste .Name = SheetName [A1].Select End With 'save book in this folder .SaveAs Filename:=MyFilePath _ & "\" & SheetName & ".xlsx" .Close SaveChanges:=True End With .CutCopyMode = False Next End With Sheet1.Activate End Sub