View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Serial Number start and end range auto-fill into cells

Put Prefix in cell A1, Start Serial Number in B1, end Serial Number in C1.
The code below will create the data you wnat starting in Row 3. Column A is
the Prefix, column B is the Serial Number, and column C is the Bar code.

Sub CreateNumbers()

Prefix = Range("A1")
StartNumber = Range("B1")
EndNumber = Range("C1")

RowCount = 3
For Count = StartNumber To EndNumber
Range("A" & RowCount) = Prefix
Range("B" & RowCount) = Count
Range("C" & RowCount) = _
"*" & Prefix & Format(Count, "#000") & "*"

RowCount = RowCount + 1
Next Count



End Sub


"buscher75" wrote:

This is my goal, to auto-fill serial number RED0001 through serial number
RED0100, for example. I would like to be able to add the prefix, RED, in one
cell and the start and end number in thier own cells also. These serial
numbers are converted to barcodes, so somewhere I will need to add an *
asterisk on both sides of the serial number.

Im not sure the best way to approach this. I would need to fill the cells
left to right (3 columns), top to bottom for printing purposes. Any ideas
would be greatly appreciated.