You save a range in Excel VBA by copying it to a new workbook and then calling SaveAs on that workbook, because a range itself has no Save method. The shortest working pattern is: Range("A1:C10").Copy, then Workbooks.Add, then ActiveSheet.Paste, then ActiveWorkbook.SaveAs "C:\Temp\MyRange.xlsx", then close the new workbook without saving again. That writes only the copied cells to a standalone file and leaves your original workbook untouched. The steps below show the full macro, how to make the filename dynamic, and how to save the range as CSV or PDF instead.

What You'll Need

  • Excel on Windows or Mac with the Developer tab enabled (File > Options > Customize Ribbon > Developer on Windows; Excel > Preferences > Ribbon & Toolbar on Mac). Labels can differ slightly by version and region.
  • A workbook containing the range you want to export, and a writable folder path such as C:\Temp\ or your Documents folder.
  • Macro security set to allow macros in your own files (File > Options > Trust Center > Trust Center Settings > Macro Settings). Avoid enabling macros in files from unknown sources.

Step-by-Step

  1. Open the VBA editor. Press Alt+F11 on Windows, or Option+F11 on Mac. In the Project pane, right-click your workbook and choose Insert > Module.
  2. Write the core macro. Paste this into the module, adjusting the range address and path:
    Sub SaveRangeAsWorkbook()
        Dim rng As Range
        Dim newWb As Workbook
        Set rng = ThisWorkbook.Worksheets("Sheet1").Range("A1:C10")
        rng.Copy
        Set newWb = Workbooks.Add
        newWb.Sheets(1).Range("A1").PasteSpecial Paste:=xlPasteValues
        Application.CutCopyMode = False
        newWb.SaveAs Filename:="C:\Temp\MyRange.xlsx", FileFormat:=xlOpenXMLWorkbook
        newWb.Close SaveChanges:=False
    End Sub
    The PasteSpecial line pastes values only, which avoids broken formulas and linked references in the new file. Use plain Paste instead if you want formulas and formatting carried over.
  3. Check the file format constant. xlOpenXMLWorkbook produces .xlsx. For a macro-free copy use that; for .xlsm use xlOpenXMLWorkbookMacroEnabled; for .csv use xlCSV with a .csv filename; for .pdf use ExportAsFixedFormat instead of SaveAs (see the tips below).
  4. Run the macro. Press F5 in the editor, or return to Excel and use Developer > Macros, select SaveRangeAsWorkbook, and click Run. Confirm the new file exists in the folder you specified.
  5. Make the filename dynamic. Replace the hard-coded path with a timestamp so each run creates a new file:
    Dim fName As String
    fName = "C:\Temp\Range_" & Format(Now, "yyyymmdd_hhnnss") & ".xlsx"
    newWb.SaveAs Filename:=fName, FileFormat:=xlOpenXMLWorkbook
    This prevents the overwrite prompt and keeps a history of exports.
  6. Save the range as CSV. CSV saves the active sheet only, so the copy-to-new-workbook approach still applies. Change the SaveAs line to newWb.SaveAs Filename:="C:\Temp\MyRange.csv", FileFormat:=xlCSV. Note that CSV loses formatting, formulas and multiple sheets — only the values in the used cells are kept.
  7. Save the range as PDF. PDF export works on a range directly, with no new workbook needed:
    rng.ExportAsFixedFormat Type:=xlTypePDF, _
        Filename:="C:\Temp\MyRange.pdf", _
        Quality:=xlQualityStandard, IncludeDocProperties:=True, _
        IgnorePrintAreas:=False, OpenAfterPublish:=False
    Set OpenAfterPublish:=True if you want the PDF to open automatically.
  8. Add error handling. Wrap the save in On Error GoTo Cleanup and put Application.CutCopyMode = False and newWb.Close SaveChanges:=False in the cleanup block, so a failed save does not leave an orphan workbook open or the marching-ants copy border stuck on screen.

Common Mistakes

  • Trying to call Save on a Range. Range("A1:C10").Save does not exist. You must copy the range to a workbook or sheet that can be saved.
  • Forgetting to close the new workbook. Each run leaves another hidden workbook open, and the next Workbooks.Add may paste into the wrong one. Always pair Workbooks.Add with Close SaveChanges:=False.
  • Saving to a folder that does not exist. SaveAs fails if the directory is missing. Create it first with MkDir or use a path you know exists.
  • Using a relative path. A bare filename saves to whatever Excel treats as the current directory, which may not be where you expect. Always supply a full path.
  • Overwriting without warning. SaveAs silently replaces an existing file unless DisplayAlerts is on. Use a timestamped name or check Dir(fName) before saving.
  • Assuming CSV keeps formatting. It does not. If you need colours, column widths or formulas, save as .xlsx.

Tips

  • Set Application.ScreenUpdating = False at the start and back to True at the end to speed up repeated exports.
  • Use ThisWorkbook rather than ActiveWorkbook when referring to your source, so the macro still works if the user switches windows mid-run.
  • If the range is a named range, refer to it as ThisWorkbook.Names("MyRange").RefersToRange so the macro survives row insertions.
  • To save only visible cells, add rng.SpecialCells(xlCellTypeVisible).Copy — useful when the source has filters applied.
  • Test with a small range first. A full-sheet copy into a new workbook can be slow and may hit memory limits on very large ranges.

Troubleshooting

If that did not work, check these in order. First, confirm the path exists and you have write permission — try saving manually to the same folder. Second, check the file extension matches the FileFormat constant; a .csv name with an .xlsx format raises an error. Third, if you get a "Method 'SaveAs' of object 'Workbook' failed" message, the likely cause is a missing folder or a file already open in another program. Fourth, if the pasted data is wrong, verify the range address and sheet name, and remember that PasteSpecial xlPasteValues drops formulas by design. Fifth, if the macro does nothing, check that macros are enabled and that the module is in the right workbook. Finally, if the new workbook stays open after an error, close it manually before rerunning, or add the cleanup block described above.

Frequently Asked Questions

Can I save a range without creating a new workbook?

Not as a standalone file. A range is part of a sheet, and sheets are saved as part of a workbook. The copy-to-new-workbook method is the standard approach. PDF export via ExportAsFixedFormat is the one exception, because it writes the range directly to a PDF.

How do I save a range as CSV with headers?

Include the header row in the copied range, for example Range("A1:C10") where row 1 holds the headers. CSV writes whatever cells you paste, so the headers travel with the data.

Why does my saved file open with formulas missing?

Because PasteSpecial xlPasteValues converts formulas to their results. Use plain Paste if you need the formulas preserved, and save as .xlsx rather than .csv.

Can I save only the selected cells?

Yes. Replace the fixed range with Selection, for example Set rng = Selection. Guard against an empty selection first, since copying nothing raises an error.

Does this work on Excel for Mac?

Yes, with two differences: use Option+F11 to open the editor, and use Mac-style paths such as /Users/YourName/Documents/MyRange.xlsx or Macintosh HD:Users:YourName:Documents:MyRange.xlsx depending on your version. The VBA objects and methods are the same.

How do I stop the overwrite prompt?

Either use a unique filename each run (a timestamp is simplest) or set Application.DisplayAlerts = False before SaveAs and restore it to True afterwards. The second option overwrites silently, so use it deliberately.