Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.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';带VBA的自定义页脚对话框_Vba_Excel - Fatal编程技术网

访问Excel';带VBA的自定义页脚对话框

访问Excel';带VBA的自定义页脚对话框,vba,excel,Vba,Excel,是否有方法使用VBA访问Excel的内置自定义页脚对话框?我想进入实际的对话框;我知道如何通过ActiveSheet.PageSetup直接修改页脚 我可以通过应用程序对话框(xlDialogPageSetup).Show打开页面设置框,但我无法进入页眉/页脚选项卡,然后是自定义页脚 以下是我尝试过的: Application.Dialogs(xlDialogPageSetup).Show Application.SendKeys "h" 'Go to the Header/Footer tab

是否有方法使用VBA访问Excel的内置自定义页脚对话框?我想进入实际的对话框;我知道如何通过
ActiveSheet.PageSetup
直接修改页脚

我可以通过
应用程序对话框(xlDialogPageSetup).Show打开页面设置框,但我无法进入页眉/页脚选项卡,然后是自定义页脚

以下是我尝试过的:

Application.Dialogs(xlDialogPageSetup).Show
Application.SendKeys "h" 'Go to the Header/Footer tab
Application.SendKeys "{TAB}{TAB}{TAB}{ENTER}", True 'Go to Custom Footer
多谢各位

编辑: 谢谢你迄今为止的回复,我为没有说得更清楚而道歉


如上所述,我了解如何使用
ActiveSheet.PageSetup
修改左/中/右页脚字段;但是,我希望直接访问“自定义页脚”对话框,以便非技术人员同事能够以熟悉的方式轻松修改这些字段,而不是让他们查看VBA并更改现有的文本字符串和/或代码。

您不必调用任何对话框。您可以直接访问页眉/页脚:

ActiveSheet.PageSetup.CenterHeader = "&D  &B&ITime:&I&B&T"

更多信息,请访问

,您不必调用任何对话框。您可以直接访问页眉/页脚:

ActiveSheet.PageSetup.CenterHeader = "&D  &B&ITime:&I&B&T"

更确切地说,它是

ActiveSheet.PageSetup.CenterFooter = "&D  &B&ITime:&I&B&T"
对于页脚

您可以访问三个点:LeftFooter、CenterFooter和RightFooter。标题将与此相同


这个问题已经被提出并得到了回答

更确切地说是

ActiveSheet.PageSetup.CenterFooter = "&D  &B&ITime:&I&B&T"
对于页脚

您可以访问三个点:LeftFooter、CenterFooter和RightFooter。标题将与此相同

此问题已被询问和回答

假设您实际尝试的是以编程方式修改文档的页眉/页脚。假设您实际尝试的是以编程方式修改文档的页眉/页脚。