Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have an excel sheet that has the title row as the first row. The rows containing the data can start upto 5 rows below the title row leaving blank rows in between. I want to insert a column as the first column containing line numbers for the rows with the data. The line numbers have to start from the row where the data exists leaving the above blank rows. Is it possible to do this programmatically using C#. I tried using an identity column but it didn't work. The error says "Invalid Operation". Please help! Thanks in advance. -- rkappini ------------------------------------------------------------------------ rkappini's Profile: http://www.excelforum.com/member.php...o&userid=31216 View this thread: http://www.excelforum.com/showthread...hreadid=508883 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Into cell A5 enter the formula =IF(B5="","",ROW()-4) or =IF(AND(B5="",A6=""),"",ROW()-4) The first one leaves row number empty, when there is no entry on row, the second one numberes all rows until last non-empty one. Instead B5="" you can have some other entry existence check for row 5 - depending on your table setup. P.e. like this =IF(AND(COUNTA($B5:X5)=0,A6=""),"",ROW()-4) Copy the formula down for any reasonable amount of rows -- Arvi Laanemets ( My real mail address: arvi.laanemets<attarkon.ee ) "rkappini" wrote in message ... I have an excel sheet that has the title row as the first row. The rows containing the data can start upto 5 rows below the title row leaving blank rows in between. I want to insert a column as the first column containing line numbers for the rows with the data. The line numbers have to start from the row where the data exists leaving the above blank rows. Is it possible to do this programmatically using C#. I tried using an identity column but it didn't work. The error says "Invalid Operation". Please help! Thanks in advance. -- rkappini ------------------------------------------------------------------------ rkappini's Profile: http://www.excelforum.com/member.php...o&userid=31216 View this thread: http://www.excelforum.com/showthread...hreadid=508883 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
inserting a row into a column that is read on another worksheet | Excel Worksheet Functions | |||
inserting a dash into a column of numbers | Excel Worksheet Functions | |||
in excel worksheet, add numbers in column k2&k3 | Excel Worksheet Functions | |||
line and column numbers | Excel Discussion (Misc queries) | |||
Counter for inserting sequence of numbers in Column C | Excel Programming |