我想通过特殊名称定义打印区域以供以后使用,例如With PrintVersion.Range("NewPrint")...
。使用VBA设置后如何命名?
我的代码的一部分:
Dim PrintVersion As Worksheet
Set PrintVersion = ThisWorkbook.Worksheets("Print version")
PrintVersion.PageSetup.PrintArea = PrintVersion.Range("A1:C" & _
PrintVersion.[LOOKUP(2,1/(C1:C250<>""),ROW(C1:C250))]).Address
我已经尝试过这种方法,但是它似乎不起作用:
Dim PrintVersion As Worksheet
Set PrintVersion = ThisWorkbook.Worksheets("Print version")
PrintVersion.PageSetup.PrintArea = PrintVersion.Range("A1:C" & _
PrintVersion.[LOOKUP(2,1/(C1:C250<>""),ROW(C1:C250))]).Address
PrintVersion.PageSetup.PrintArea = "NewPrint"