Created automatically sequence numbers

G

Guest

How can I create an automatically sequernce numbers?.
The program I have create an automatically database from the column "B" to
column "N". However, everytime I have the data written I have to type the
serial number on the correspond column "A". I wonder if I can add a statement
to write automatically the serial number in the column "A". This number will
start from 7047.001 so next one will be 7048.001, 7049.001 and so on.

Thanks in advance.
Maperalia
 
G

Guest

Sub AddNumbers()
Dim i as Long, j as long
i = 2
j = 7047
do while cells(i,2) <> ""
cells(i,1) = j + .001
j = j + 1
i = i + 1
Loop
End Sub
 
G

Guest

Tom;
Thnaks for your quick response.
I typed the 7047.001 in the cell "A1" and run the macro and it is doing
nothing. Do I missing something?

Maperalia
 
G

Gord Dibben

Tom explained in an earlier post that i = 2 means A2

If you want A1 to be included change the 2 to 1


Gord Dibben MS Excel MVP
 
G

Gord Dibben

In addition, you don't have to type any number in column A

The line j = 7047 takes care of that.

But you do need data in column B


Gord
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top