I have an Excel table (not a pivot table) and I have VBA code that sorts the table, filters rows, etc. I want the macro to then print the table after the sorting/filtering are done.
I can get it to show the printpreview screen, but there I need to MANUALLY select the "Print the Selected Table" option (it defaults to "Print the Worksheet"). How can I do this inside my VBA code so that I can create a button that runs the macro and the macro does everything except execute the print (i.e., it does the sorting, the filtering, selects the table, brings up the print preview, and selects the "Print Selected Table" option) so my user only has to then click the Print button or cancel out? Right now, I can get it to do everything except telling the print job that I want to print the selected table.
I can get it to show the printpreview screen, but there I need to MANUALLY select the "Print the Selected Table" option (it defaults to "Print the Worksheet"). How can I do this inside my VBA code so that I can create a button that runs the macro and the macro does everything except execute the print (i.e., it does the sorting, the filtering, selects the table, brings up the print preview, and selects the "Print Selected Table" option) so my user only has to then click the Print button or cancel out? Right now, I can get it to do everything except telling the print job that I want to print the selected table.