How to Save an Excel Table as Image in Excel

This tutorial will introduce three methods for saving an Excel table as an image in Excel: “Paste as picture”, “Paint tool”, and “VBA code“.

The Paste as picture method allows you to create a picture of a range that can be easily inserted into documents or presentations.

The Paint tool method uses the built-in Windows Paint program to save the selected range as an image.

The VBA code method automates the process of saving the selected range as an image using Visual Basic for Applications (VBA) code.

Save Table as Image using Paste as Picture

You can save an Excel table as an image using the “paste as picture” feature. Here are the steps:

Step1: Select the table that you want to save as an image.

How to Save an Excel Table as Image in Excel 1.png

Step2: Right-click on the selected cells and choose “Copy” from the context menu or press Ctrl+C on your keyboard.

How to Save an Excel Table as Image in Excel 2.png

Step3: select one destination cell to place the image.  Then click the Home tab, click on the drop-down menu list from the Paste option in the Clipboard group.  Click on the Picture option.

How to Save an Excel Table as Image in Excel3.png

Now you can simply copy the image and paste it to other application.

Save Table as Image using Paint Tool

You can save an Excel table as an image using the Paint tool in Windows. Here are the steps:

Step1: Select the table that you want to save as an image.

Step2: Right-click on the selected cells and choose “Copy” from the context menu or press Ctrl+C on your keyboard.

Step3: Open the Paint tool by typing “Paint” in the Windows search bar and selecting the app from the search results.

Step4: In Paint, choose “Paste” from the “Home” tab or press Ctrl+V on your keyboard to paste the copied table into the canvas.

How to Save an Excel Table as Image in Excel4.png

Step5: Choose “Save As” from the “File” menu and select the desired file format (e.g. JPEG, PNG, BMP, etc.).

How to Save an Excel Table as Image in Excel5.png

Step6: Enter a file name and choose a save location. Click “Save” to save the image.

How to Save an Excel Table as Image in Excel6.png

Save Table as Image with VBA Code in Excel

You can use VBA code in Excel to save a selected table as an image and prompt the user to select a destination to save the image. Just do the following steps:

Step1: Open your Excel workbook.

Step2: Press Alt + F11 to open the VBA editor.

Step3: In the VBA editor, select Insert from the menu bar, then choose Module to create a new module.

Step4: Copy the VBA code I provided and paste it into the new module. Save the workbook and close the VBA editor.

vba to Save an Excel Table as Image in Excel 1.png
Sub sleep(T As Single)
    Dim time1 As Single
    time1 = Timer
    Do
        DoEvents
    Loop While Timer - time1 < T
End Sub
Sub SaveTableAsImage_excelgeek()
    Dim tbl As Range
    Dim savePath As String, fileName As String, fileFormat As String
    Dim cht As ChartObject
      
    'Prompt the user to select the table to save as an image
    Set tbl = Application.InputBox("Select the table to save as an image:", Type:=8)

    tbl.CopyPicture xlScreen, xlPicture
 
     'prompt user for save location and file name
    savePath = Application.GetSaveAsFilename(InitialFileName:="table1", _
        FileFilter:="JPEG (*.jpg), *.jpg, PNG (*.png), *.png")
    If savePath = "False" Then Exit Sub ' exit if user clicks cancel
     
    'extract file name and format from save path
    fileName = Mid(savePath, InStrRev(savePath, "\") + 1)
    fileFormat = Mid(fileName, InStrRev(fileName, ".") + 1)
    fileName = Left(fileName, InStrRev(fileName, ".") - 1)
    
    
    'create temporary chart object, set dimensions to table dimensions, paste table inside, and save as image
    Set cht = ActiveSheet.ChartObjects.Add(0, 0, tbl.Width, tbl.Height)
    Call sleep(2)
    cht.Chart.Paste
    cht.Chart.Export savePath, fileFormat
    cht.Delete
    Application.CutCopyMode = False
    
End Sub

Step5: Press Alt + F8 to open the Macros dialog box. Select the SaveTableAsImage_excelgeek macro from the list and click the Run button.

vba to Save an Excel Table as Image in Excel 2.png

Step6: Select the table to save as an image.

vba to Save an Excel Table as Image in Excel 3.png

Step7: select one the location to place image.

vba to Save an Excel Table as Image in Excel 4.png

Step8: The picture will be saved into the selected location.

vba to Save an Excel Table as Image in Excel 5.png

Conclusion

There are several methods available for saving an Excel table as an image, each with its own advantages and limitations. The “Paste as picture” method is quick and easy, but may result in lower image quality. The “Paint tool” method provides greater control over image quality, but requires an extra step. The “VBA code” method offers the most automation and customization options, but may require some programming knowledge.

Leave a Reply

Your email address will not be published. Required fields are marked *