continuos numbering within a cell

  • Thread starter Thread starter automatic numbering
  • Start date Start date
A

automatic numbering

Hi,
I was wondering if there is a way to number within a cell automatically with
out having to do alt enter?
ex: 1.
2..etc.

thanks
 
You could try this macro (it will ask you how many numbers to insert into
the cell and then do it, auto-fitting the height of the cell afterwards)...

Sub InsertNumbers()
Dim X As Long
Dim HowMany As Long
Dim Counter As String
HowMany = InputBox("How many numbers?")
If IsNumeric(HowMany) Then
For X = 1 To HowMany
Counter = Counter & X
If X < HowMany Then Counter = Counter & vbLf
Next
With ActiveCell
.Cells.WrapText = True
.Value = Counter
.Rows.AutoFit
End With
End If
End Sub
 
Back
Top