简体   繁体   English

当我在Excel中运行宏时,标题被切断

[英]Header gets cut off when I run a macro in Excel

I have a header set up in a master spreadsheet in which I run different macros off of to sort the information differently. 我在主电子表格中设置了标题,在其中运行了不同的宏以对信息进行不同的排序。 When I run the macros, the bottom portion of my header is cut off. 当我运行宏时,标题的底部被切除。 My header does contain an image(not sure if this has anything to do with it). 我的标头确实包含图片(不确定是否与图片有关)。 I also run the following prtion of code in all of the macros to format the first row of information: 我还在所有宏中运行下面的代码防护以格式化第一行信息:

Rows("1:1").WrapText = True
Rows("1:1").RowHeight = 55
Columns("J:J").ColumnWidth = 9
Rows("1:1").HorizontalAlignment = xlCenter
Rows("1:1").VerticalAlignment = xlBottom

I think this may have something to do with the header getting cut off since i change the height of the row, but I am unsure how to approach this problem. 我认为这可能与标题更改有关,因为我更改了行的高度,但是我不确定如何解决此问题。 Thanks for the help. 谢谢您的帮助。

I just figured it out. 我只是想通了。 I had to remove 我必须删除

Header:=xlYes 

and add 并添加

ActiveSheet.PageSetup.TopMargin = 90

尝试将.WrapText = True放在最后。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM