View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
dominicb[_43_] dominicb[_43_] is offline
external usenet poster
 
Posts: 1
Default 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