本文介绍了insertrowrange始终在Excel 2007 vba中不返回任何内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Excel 2003中,我可以使用ListObject.InsertRowRange属性来定位我的选择,以便将新数据插入到列表中(2003)(或excel表(2007))

代码段:

将mylo调暗为列表对象
将暗淡的myLoRowRng作为范围
将暗淡的myPlaceholderRow作为ListRow

设置myLO = TimeTrackingData.ListObjects(1)
设置myPlaceholderRow = myLO.ListRows(myLO.ListRows.Count)
myPlaceholderRow.Range.Activate
设置myLoRowRng = myLO.InsertRowRange

在这种情况下,myLoRowRng.Address是范围只要myLO.Active评估为TRUE,就可以使用InsertRowRange。

在Excel 2007中,使用与上面相同的代码,myLO.InsertRowRange始终返回"nothing"。即使我的ListObject.Active属性计算为TRUE。此外,在Excel 2007中,"插入行"表示"插入行"。永远不可见(即标有星号"*")。 Excel 2007 VBA帮助和Excel 2007对象模型都指示InsertRowRange属性存在且不被弃用。实际上是否删除了此功能?

是否有其他人能够使用insertrowrange属性?

解决方案

In Excel 2003, I could use the ListObject.InsertRowRange property to position my selection for inserting new data into a list (2003) (or excel table (2007))

code snippet:

Dim myLO As ListObject
Dim myLoRowRng As Range
Dim myPlaceholderRow As ListRow

Set myLO = TimeTrackingData.ListObjects(1)
Set myPlaceholderRow = myLO.ListRows(myLO.ListRows.Count)
myPlaceholderRow.Range.Activate
Set myLoRowRng = myLO.InsertRowRange
   
In this case, myLoRowRng.Address is the range of the InsertRowRange as long as myLO.Active evaluated to TRUE.

In Excel 2007, using the same code as above, myLO.InsertRowRange always returns "nothing" even though my ListObject.Active property evaluates to TRUE.  Also, in Excel 2007, the "insert row" is never visible (i.e. marked with an asterisk "*").  The Excel 2007 VBA help and Excel 2007 Object model both indicate that the InsertRowRange property exists and is not deprecated.  Has this functionality actually been removed?

Has anyone else been able to use the insertrowrange property?

解决方案


这篇关于insertrowrange始终在Excel 2007 vba中不返回任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 23:12