我有一个简单的宏,它被记录来格式化一些单元格并设置一些页面格式(页边距页脚页眉等。)宏运行没有错误,它格式化单元格很好,但不保存/更改任何页面设置选项。在我运行它之后,如果我检查页面设置,一切仍然是默认的。下面是页面设置部分。我已经在多个文件/工作簿上尝试过这个,无论如何它似乎都没有保存更改。有任何想法吗?
谢谢
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "&F"
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = "Page &P of &N"
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.5)
.HeaderMargin = Application.InchesToPoints(0.25)
.FooterMargin = Application.InchesToPoints(0.25)
.PrintGridlines = True
.Orientation = xlLandscape
.FirstPageNumber = xlAutomatic
.FitToPagesWide = 1
End With