You can determine the cell type of the active cell. You can use the GetCellType method of the SheetView class.