我必须在Excel表中插入一个空行。 要在我正在使用的表中插入行:
bugetTable.ListRows.Add AlwaysInsert:=True到目前为止一切顺利,但理想的结果是整行需要移动而不仅仅是表中的行。 我的意思是,表范围是四列宽,所以我需要插入的行占用超过四列。 我使用表而不是范围行方法来满足技术要求。
我使用的是Office 2010,Windows 8.1。
I have to insert a blank row in an Excel Table. To insert the row in the Table I am using:
bugetTable.ListRows.Add AlwaysInsert:=TrueSo far so good, but the desired result is that the entire row needs to be shifted not just the row in the Table. What I mean is, the Table range is four columns wide, so I need that the inserted row take more than the four columns. I am using the Table instead of the range row approach for technical requirements.
I am using Office 2010, Windows 8.1.
最满意答案
Dim b As Integer Dim b As Integer另外3个步骤:
获取表格的最后一行:
a = ListObjects(YourTable).Range.Rows.Count获取表格开始的行:
b = ListObjects(YourTable).Range.Cells(1).Row在表格末尾插入行:
Rows(a + b - 1).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove Dim b As Integer Dim b As IntegerAnd, additional 3 steps:
Get the last row of the table:
a = ListObjects(YourTable).Range.Rows.CountGet the row your table begins:
b = ListObjects(YourTable).Range.Cells(1).RowInsert row by the end of the table:
Rows(a + b - 1).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove更多推荐
发布评论