Printing tabs listed in a separte worksheet in Excel using VBA

Stevep4

New Member
Joined
Aug 28, 2015
Messages
35
I have code provided by a fellow user that works when printing a list of tabs in cells. For example, the tab called "PrintPage" has a list of tabs from G12:G15. The following code works to print those tabs:

Rich (BB code):
Sub printShtsTEST()
Dim Ary As Variant
  Application.Dialogs(xlDialogPrinterSetup).Show
   WithSheets("PrintPage")
      Ary =Application.Transpose(.Range("G12", .Range("G" &Rows.Count).End(xlUp)).Value)
   End With
  Sheets(Ary).PrintOut
End Sub


However, if I try to print a list of tabs from C12:C15, I get an error saying "Printout method of sheets class Failed." I have no idea why changing the column causes an error when it's the exact same code, just pointing to a different column (C instead of G). Does anyone know what I'm missing?
 
Last edited:

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,224,875
Messages
6,181,516
Members
453,050
Latest member
Obil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top