问题
I am trying to print the active worksheet and another worksheet with general information (in the same workbook) at the same time. (Recto verso, which my printer does automatically, no code needed for that)
In my workbook I have multiple sheets that use the same code for printing. Now I would like to add the sheet with general information called "Huurvoorwaarden" to an array so it is printed automaticaly and at the back side of the active sheet.
I have tried multiple sollutions like dim / set activesheet.name, and codes which I have found on the web. nothing works. I know that when I would change "activesheet" to Sheet1, that would work, but only for sheet 1.
Could you please help me?
Here is what I have got: (all my older attempts are deleted)
'Print Active Sheet and sheet Huurvoorwaarden
Worksheets(Array("activesheet.name", "Huurvoorwaarden")).PrintOut
回答1:
The name of the active sheet is not the string literal "ActiveSheet.Name"
, it is the property ActiveSheet.Name
.
So you need to use
Worksheets(Array(Activesheet.Name, "Huurvoorwaarden")).PrintOut
来源:https://stackoverflow.com/questions/46970978/declare-activesheet-to-array-for-printing-2-sheets-of-workbook