title: VBA. How to exclude hide sheet from this export code?
body: <pre><code>Sub SaveShtsAsBook() 
      ‘Select all visible and hide sheet’
      Dim Sheet As Worksheet, SheetName$, MyFilePath$, N&amp; 
      MyFilePath$ = ActiveWorkbook.Path &amp; "\" &amp; _ 
      Left(ThisWorkbook.Name, Len(ThisWorkbook.Name) - 4) 
      With Application 
          .ScreenUpdating = False 
          .DisplayAlerts = False 
           '      End With
          On Error Resume Next '&lt;&lt; a folder exists
          MkDir MyFilePath '&lt;&lt; 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 _ 
                  &amp; "\" &amp; SheetName &amp; ".xlsx" 
                  .Close SaveChanges:=True 
              End With 
              .CutCopyMode = False 
          Next 
      End With 
      Sheet1.Activate 
  End Sub 
  </code></pre>
  
  <p>I want to create individual excel workbook with only 1 sheet inside but I do not want to include those sheet that are hiding, yet I cant delete them cause I need them next time.</p>