View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
serhio serhio is offline
external usenet poster
 
Posts: 4
Default How to group empty cells in a column

I just tried to group the "empty" rows at once, in this way:

excelWorksheet.UsedRange.SpecialCells(XlCellType.x lCellTypeBlanks,
Missing.Value).Group(Missing.Value, Missing.Value, Missing.Value,
Missing.Value);

but I've obtained:
"
The command you chose cannot be performed with multiple selections.
Select a single range and click the command again.
"

System.Runtime.InteropServices.ExternalException
{System.Runtime.InteropServices.COMException}


"Joel" wrote:

set emptycells = Columns("A:A").SpecialCells(xlCellTypeBlanks)

You may get one extra cell at row after the last row of your data.