当我在Excel中运行宏时,标题被截断 [英] Header gets cut off when I run a macro in Excel

查看:139
本文介绍了当我在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 

并添加

ActiveSheet.PageSetup.TopMargin = 90

这篇关于当我在Excel中运行宏时,标题被截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆