Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 11-03-2019, 02:36 PM
Logit Logit is offline How to clone a worksheet with udf in excel 2007? Windows 10 How to clone a worksheet with udf in excel 2007? Office 2007
Expert
 
Join Date: Jan 2017
Posts: 591
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

This will save each sheet in the same location as the workbook :

Code:
Option Explicit

Sub save_each_sheet_as_separate_workbook()
     
     
    Dim wb As Workbook, ws As Worksheet
     
    Application.ScreenUpdating = False
    
''///////////   Include WB to be affectted in path below   \\\\\\\\\

    Set wb = ThisWorkbook 
     
    For Each ws In wb.Worksheets
        If ws.Visible = True Then 'handles hidden sheets
            ws.Copy
            With ActiveWorkbook
                .SaveAs Filename:=ThisWorkbook.Path & "\" & ws.Name, FileFormat:=56 '56 for xls, 51 for xlsx, 52 for xlsm
                .Close False
            End With
        End If
    Next ws
     
    wb.Close False
     
    Application.ScreenUpdating = True
     
End Sub
You can edit the path for your purposes.
Reply With Quote
 

Tags
vba excel

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 opens with worksheet displayed rbul1 Excel 3 01-06-2019 06:25 AM
Excel Calendar in a worksheet kenbird Excel 0 04-26-2015 02:48 AM
Worksheet Object in powerpoint 2007 sridharreddyg20 PowerPoint 0 03-06-2014 12:05 PM
Paste special an Excel range into Outlook as an Excel Worksheet charlesh3 Excel Programming 3 02-04-2013 04:33 PM
How to clone a worksheet with udf in excel 2007? Clone Outlook Settings pmokover Outlook 1 08-30-2010 12:04 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:02 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft