简体   繁体   中英

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放在最后。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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