Home 
Search 
Today's Posts 
#1
Posted to microsoft.public.excel.programming




incrementing every two rows
Hello:
I have a spreadsheet, and I need to number each set of two rows throughout the spreadsheet. For example, the first two rows need to be numbered 1, the second two rows need to be numbered 2, the third two rows need to be numbered 3, and so forth. This spreadsheet has over 16,000 rows. Is there a quick way of doing this? Thanks! childofthe1980s 
#2
Posted to microsoft.public.excel.programming




incrementing every two rows
One way:
Select A1:A16xxx. Enter this in the formula bar using CTRLEnter =INT((ROW()+1)/2) In article , childofthe1980s wrote: Hello: I have a spreadsheet, and I need to number each set of two rows throughout the spreadsheet. For example, the first two rows need to be numbered 1, the second two rows need to be numbered 2, the third two rows need to be numbered 3, and so forth. This spreadsheet has over 16,000 rows. Is there a quick way of doing this? Thanks! childofthe1980s 
#3
Posted to microsoft.public.excel.programming




incrementing every two rows
Good evening Childofthe1980s You can do this through using VBA. Copy this code to the clipboard: Sub NumberRow() Application.ScreenUpdating = False a = 1 For b = 1 To 8000 ActiveCell.Value = a ActiveCell.Offset(rowOffset:=1).Activate ActiveCell.Value = a ActiveCell.Offset(rowOffset:=1).Activate a = a + 1 Next b Application.ScreenUpdating = True End Sub In excel right click your sheet tab and select View Code and paste thi into the blank window. The "For B=..." line, make the 8000 exactly hal of the number of cells your are numbering, then close the window and g back to Excel. Click on the first cell you want to number and go t Tools Macro Macros, select "NumberRow" and click OK. The routine may take a second or so to run depending on the speed o your system. HTH Dominic  dominic  dominicb's Profile: http://www.excelforum.com/member.php...fo&userid=1893 View this thread: http://www.excelforum.com/showthread.php?threadid=38212 
#4
Posted to microsoft.public.excel.programming




incrementing every two rows
Interesting solution from JE again........
Keep forgetting about the CNTRLENTER Of course you would after that do the <edit<copy<paste<paste special<values thing to convert the formula's to values. One other way would be to extend a simple 1,2,3 range to 8xxx (i.e. halfway) copy that and paste it into the second half and finish with a sort. You may have to do this on a empty sheet and copy the result across.  Greetings from New Zealand Bill K "JE McGimpsey" wrote in message ... One way: Select A1:A16xxx. Enter this in the formula bar using CTRLEnter =INT((ROW()+1)/2) In article , childofthe1980s wrote: Hello: I have a spreadsheet, and I need to number each set of two rows throughout the spreadsheet. For example, the first two rows need to be numbered 1, the second two rows need to be numbered 2, the third two rows need to be numbered 3, and so forth. This spreadsheet has over 16,000 rows. Is there a quick way of doing this? Thanks! childofthe1980s 
Reply 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Forum  
Incrementing Rows and Columns  Excel Discussion (Misc queries)  
fill down formula incrementing by every 12 rows  Excel Discussion (Misc queries)  
Incrementing formula by two rows  Excel Worksheet Functions  
Automatically 'incrementing' formulas for new rows.  New Users to Excel  
Problem incrementing rows  Excel Programming 