Excluding a range when copy a worksheet

termeric

Board Regular
Joined
Jun 21, 2005
Messages
236
Hello, I want to copy 3 worksheets to a new workbook, but exclude a range from one of the worksheets (and any buttons on the worksheet as well. I want to exclude J1:U2 on "Metric Report" Is there a way to do this?


this is what I am using right now

Code:
Sub ThreeSheets()
With ActiveWorkbook.Sheets(Array("Metric Report", "Rubric", "Counts"))
    .Copy
    
    ActiveWorkbook.SaveAs Filename:=GetFolder & Application.PathSeparator & "Metric Report.xlsx", FileFormat:=51
End With
End Sub



Function GetFolder() As String
    Dim fldr As FileDialog
    Dim sItem As String
    Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
    With fldr
        .Title = "Select a Folder"
        .AllowMultiSelect = False
        .InitialFileName = Application.DefaultFilePath
        If .Show <> -1 Then GoTo NextCode
        sItem = .SelectedItems(1)
    End With
NextCode:
    GetFolder = sItem
    Set fldr = Nothing
End Function
 
Last edited:

MARK858

Well-known Member
Joined
Nov 12, 2010
Messages
11,330
Office Version
365, 2010
Platform
Windows, Mobile
Is there any reason you can't just delete the range on the sheet between the Copy and the Save?
 

Forum statistics

Threads
1,078,310
Messages
5,339,417
Members
399,303
Latest member
Plczrode

Some videos you may like

This Week's Hot Topics

Top