Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Excel中以黑白不同的纸张打印_Excel_Vba - Fatal编程技术网

在Excel中以黑白不同的纸张打印

在Excel中以黑白不同的纸张打印,excel,vba,Excel,Vba,经过大量的研究和稀疏的结果,对于许多人来说,StackOverflow是最后的解决方案:D 我已经设法创建了一个宏来打印我想要的页面,但是我想用黑白打印其中的一些页面,我正在与代码斗争。它就是不起作用。我想用黑白印刷一些纸张,但不是全部 下面是我的代码: Sub Impression() 'Impression Macro If Range("E9").Value Like "C1" Then With Sheets(Array("Inpu

经过大量的研究和稀疏的结果,对于许多人来说,StackOverflow是最后的解决方案:D

我已经设法创建了一个宏来打印我想要的页面,但是我想用黑白打印其中的一些页面,我正在与代码斗争。它就是不起作用。我想用黑白印刷一些纸张,但不是全部

下面是我的代码:

Sub Impression()

'Impression Macro

If Range("E9").Value Like "C1" Then

With Sheets(Array("Input", "Design", "Flexion", "Tranchant", "Compression", "Connexion mecanique"))

  .PrintPreview

  '.PrintOut Copies:=1

  .PageSetup.BlackAndWhite = True

End With

End If*


If Range("E9").Value Like "P1" Or Range("E9").Value Like "P2" Or Range("E9").Value Like "P3" Or Range("E9").Value Like "P4" Then

End With

With Sheets(Array("Input", "Design", "Flexion", "Tranchant", "Compression"))

  .PrintPreview

  '.PrintOut Copies:=1

  .PageSetup.BlackAndWhite = True

End With

End If

End Sub
如果有人能提供解决方案,那将非常有帮助。 当我删除黑白部分时,打印代码正在工作

顺便说一句,我从VBA开始,现在,我正在谷歌上寻找我需要的代码。你知道一本好的手册或课程来改进我的编码吗

最后但并非最不重要的一点,当我在VBA上进行编码时,我可以说“编码”吗D

谢谢 米尔扎