Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm using COM automation inside an xll to program Excel. At one point in the code, I do the following to retreive a Range of cells : "range = range.GetResize(COleVariant(rows), COleVariant(cols));" Is there a way (other than iterate over all the cells in the range) to know if the range is empty? Thanks. By the way, is there a place where I can find some documentation of those Excel Ole object? Nic |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can count the number of occupied cells and see if it is zero. For
instance: If Application.COUNTA(TheRange) = 0 Then ............. HTH Otto wrote in message oups.com... Hi, I'm using COM automation inside an xll to program Excel. At one point in the code, I do the following to retreive a Range of cells : "range = range.GetResize(COleVariant(rows), COleVariant(cols));" Is there a way (other than iterate over all the cells in the range) to know if the range is empty? Thanks. By the way, is there a place where I can find some documentation of those Excel Ole object? Nic |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() have a look at the specialcells property of a range. You may find one of these will answer your needs. eg: Set rngb = rnga.SpecialCells(xlCellTypeBlanks) Regards, -- tony h ------------------------------------------------------------------------ tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074 View this thread: http://www.excelforum.com/showthread...hreadid=505366 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, it works great.
And what if I have another representation of the Range like an XLOPER array. _result.xltype = xltypeMulti; _result.val.array.lparray = xlValues; where xlValues is an array of XLOPER - Is there a way to take the array, make a COM Range object and call the COUNTA function? - Or should I loop over all elements of the array - Or is there another undocumented C Api function for this ;-) Thanks, Nic |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding next empty empty cell in a range of columns | Excel Programming | |||
Range empty? | Excel Programming | |||
why is range empty? | Excel Discussion (Misc queries) | |||
why is range empty? | Excel Programming | |||
empty variable range | Excel Discussion (Misc queries) |