View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default creating number sequence

Paul,

try this

Sub dec2oct()
x = 1
y = 0
Do
Cells(x, 1).Value = Oct(x)
Cells(x, 3).Value = y
If x 1 Then
If x Mod 2 = 0 Then
Cells(x, 3).Value = Cells(x, 3).Offset(-1, 0).Value + 77
Else
Cells(x, 3).Value = Cells(x, 3).Offset(-1, -0).Value + 23
End If
End If
x = x + 1
Loop Until Cells(x - 1, 1).Value = 7777
End Sub


Mike

"Paul Tikken" wrote:

I'm using excel 2003

I would like to create a macro that is creating a number sequence (from 0 to
77777) only using the numbers 0 tru 7. So when I select a cel say A1 and I
run the macro the first column needs to be filled with:
1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20 etc etc etc.

An other macro I would like to create is one that provides me with the
following number sequence (lets say in column C)

0, 77, 100, 177, 200, 277, 300, 377, 400, 477, 500, 577 etc etc etc

Can anybody help me with this?

Regards,

Paul