+ Reply to Thread
Results 1 to 2 of 2

Delete all hidden worksheet on multiple files

  1. #1
    Registered User
    Join Date
    07-04-2016
    Location
    Manila Philippines
    MS-Off Ver
    Philippines
    Posts
    3

    Delete all hidden worksheet on multiple files

    Hi guys!

    I got lots of excel files of the same template and was wondering if you could help me delete all hidden tabs without coding them one by one.

    Can below code can be converted so that it would delete all hidden worksheets of all excel files in a folder?

    Sub deletehiddenwbs()
    Application.DisplayAlerts = False
    For Each ws In Worksheets
    If ws.Visible <> True Then ws.Delete
    Next
    Application.DisplayAlerts = True
    End Sub

    Or if you have any alternative in deleting them in one go please do let me know.

    Thank you very much in advance!

    Sincerely,
    Jowj

  2. #2
    Registered User
    Join Date
    07-04-2016
    Location
    Manila Philippines
    MS-Off Ver
    Philippines
    Posts
    3

    Re: Delete all hidden worksheet on multiple files

    Hi Guys so I found this online. How would I combine the two codes so it would run?

    Code below loops through files in a folder.

    Sub AllFiles()
    Dim folderPath As String
    Dim filename As String
    Dim wb As Workbook

    folderPath = "C:\SAP Imports\Sales Orders\" 'change to suit

    If Right(folderPath, 1) <> "\" Then folderPath = folderPath + "\"

    filename = Dir(folderPath & "*.ped")
    Do While filename <> ""
    Application.ScreenUpdating = False
    Set wb = Workbooks.Open(folderPath & filename)

    'Call a subroutine here to operate on the just-opened workbook
    Call 'name of your other macro here

    filename = Dir
    Loop
    Application.ScreenUpdating = True
    End Sub

    Help

    Sincerely,
    Jowj

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Multiple text files listed in a worksheet and the data to consolidated in a worksheet
    By balaji.rk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-17-2015, 07:41 PM
  2. Merging multiple excel files in a folder into one master worksheet in a new worksheet
    By johnny_canuck in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-22-2013, 12:20 PM
  3. [SOLVED] Combine multiple (100+) excel files w/ one worksheet each into one giant worksheet
    By justin11 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-03-2013, 01:05 PM
  4. Delete all files in directory, msgbox list files before delete.
    By randell.graybill in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2010, 09:28 PM
  5. Getting data from hidden files and leaving them hidden
    By CJPHX in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-12-2010, 04:15 PM
  6. Replies: 5
    Last Post: 02-17-2010, 02:02 PM
  7. Replies: 3
    Last Post: 03-12-2006, 06:00 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1