Forum Discussion

Logan_Weaver's avatar
Logan_Weaver
Copper Contributor
Aug 16, 2021

Macro to change DPI

Good day!

 

First off, I am not an Excel expert at all, so I apologize for a question that may or may not be really dumb 🙂

 

I am in need of a macro in Excel that would change the DPI of a single worksheet. The reason for this is because occasionally I have a worksheet that needs to be set to 204x196 DPI in order to print/fax properly. I would basically like to achieve what is in this guide: https://support.microsoft.com/en-us/office/change-the-print-resolution-or-print-quality-for-a-worksheet-b0e11707-1e47-4452-810f-0f4deb038455 but through a macro.

 

If it needs to be done manually that is fine, but hopefully someone can provide some guidance? 🙂 Thank you!!

2 Replies

  • Logan_Weaver 

    You can use this for the active sheet:

     

    ActiveSheet.PageSetup.PrintQuality = Array(240, 196)

     

    or for a specific sheet that is not necessarily the active sheet:

     

    Worksheets("Specific Sheet").PageSetup.PrintQuality = Array(240, 196)

     

    But the active printer must support that, otherwise you'll get an error message.

Resources